Most likely, the cause of your problem is that jQuery is in compatibility mode. This means that you can’t use the ‘$’ shortcode.
To get your Javascript code to work, replace all ‘$’ with ‘jQuery’
Or, wrap your code in an anonymous function, like this:
jQuery(document).ready(function( $ ) {
// Put your jQuery code here.
});
See: https://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/
Related Posts:
- JavaScript Loading Screen while page loads
- Click button copy to clipboard
- How to make html table vertically scrollable
- How to make Bootstrap carousel slider use mobile left/right swipe
- bootstrap 3 navbar collapse button not working
- How to center image in carousel
- Can Twitter Bootstrap alerts fade in as well as out?
- Play/pause HTML 5 video using JQuery
- jQueryUI dialog width
- Random background images CSS3
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- Automatically decrease font size for long words
- Best approach for loading a sidebar Only if the screen max-width is >900px?
- Twitter Bootstrap Use Collapse in Custom Post Type
- Stylizing external SVG files with jQuery and CSS
- Gravity list field override and adding javascript [closed]
- Add a class to posts in increments of 2
- Override theme style with other CSS on a specific page
- How can I make this custom menu work?
- Remove WordPress scripts
- How to make an WordPress element sticky? [closed]
- Accordion scrolls page too low after clicking on the title [closed]
- Cannot enqueue jQuery correctly using Google CDN
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- Superfish Menu Not Loading
- Problem Implementing parallax in header of bp-default theme
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- Is it OK combined wp-include js, jquery, css? [closed]
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- jQuery Validation plugin and Bootstrap 4 CSS classes
- Getting click on item to open closest relevant element (popup) with jQuery
- How Do I change Markup of a link in WordPress
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Lightbox scroll page down on iPhone
- jQuery function not working in WordPress but works in jsfiddle
- Site images are fixed in front of my site content [closed]
- WP Media Uploader modal conflicts with Bootstrap modal
- :first-child applying to all links [closed]
- How to update scrollbar when using Jetpack’s Inifnite Scroller?
- Hide input field when second input field is in focus
- change the icon of a custom post type in WordPress to use twitter boostrap
- Drop Down Category Menu Not Working
- controlling the showing and hiding of the website logo
- How do I add Javascript and CSS files into WordPress?
- can’t make jQuery work (change image on time interval) [closed]
- My javascript is returning this error: $.ajax is not a function
- Invalid or unexpected token on a very simple function
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- How to get a cross-origin resource sharing (CORS) post request working
- jquery – return value using ajax result on success
- onclick event pass
- id or value
- Can you detect “dragging” in jQuery?
- Twitter Bootstrap Modal Form Submit
- How can I remove a style added with .css() function?
- How to overwrite a JavaScript core function?
- Custom function to rearrange attachments when creating posts – Almost there
- Horizontal scroller with post_thumbnail’s
- $wp_customize customizer_preview_init not firing inside javascript
- jQuery code not firing on page despite registering and enqueuing scripts
- How to use Bootstrap with WP’s jQuery? [closed]
- WordPress site in China times out on requests to youtube [closed]
- No data received
- CodeMirror on Custom Widget Textarea
- Sending click events to Google Analytics in WordPress: the easy way
- Retrieve post info within AJAX helper function
- Fall Back Google CDN in JavaScript
- wp_enqueue doesn’t work
- WP-admin redirects to login after adding SSL certificate
- Dynamicaly update field created with wp_editor()
- add custom HTML css with js doesn’t work
- Change quantity via jQuery and disabile quantity field [closed]
- Get value of selected option in select field in a WordPress form
- jQuery – Toggle megamenu submenu items by click
- General Settings: display custom plugin field after Site Address field
- WordPress Insert not working with ajax
- WP AJAX API with JS file
- need to override function in jquery.ui.datepicker.js
- Dynamic WordPress editor in meta box
- How to modify iFrame content in an admin thickbox
- How to wrap posts into divs?
- jquery.min has very long TTFB
- animate.style on wp-login.php
- Form validation before submitting
- bundled jquery in theme js not working with wp_localize_script
- How to toggle custom WP archive list
- I can’t enqueue Suggest.js in frontend – not added
- Jquery code won’t run loaded from WP, but run from console
- JQuery is not defined but jquery script is loaded in source [closed]
- owl carousel not working after ajax load [duplicate]
- jQuery post method in admin menu
- jquery not working correctly in plugin options page?
- jQuery AJAX add json2 dependency?
- How to read the contents of single post through RSS feed
- jQuery Ajax / Modal admin event not firing since 3.6. Seems to not recognize “a” tag
- Auto Select Child categories on Multiple Dropdown – Jquery
- WordPress video end function [duplicate]
- Adding css and js to a blank page created with custom template
- Sliders with buttons [closed]
- Enqueued jQuery not working