As toscho pointed out, use jQuery(document).ready(function($) { ... });
instead of $( function() { ... });
Edit: Main problem is WP rich text editor escaping your html <script>
tags. See https://codex.wordpress.org/Using_Javascript at the bottom of the page for a plugin-based workaround to turn off formating for specific posts/pages, allowing you to insert code.
Alternately, add JavaScript to appropriate template file or enqueue in functions.php as external script.
Related Posts:
- JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error
- Deregistering a script in WordPress seems impossible
- Double jQuery loaded
- Removed jQuery script from header.php , any problems?
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- When to use wp_register_script() function?
- Adding javascript files to WordPress and jQuery version
- JQuery UI Autocomplete showing as bullets
- AJAX pagination, update current page
- Limit Widgets to Sidebar ID’s
- Save Search System
- adjust section according to country?
- populate form fields in a loop with ajax
- dynamic dependent select dropdown
- Change “add to cart” button color based on Woocommerce product category [closed]
- How can I get the values of my WordPress $wpdb query in Jquery?
- Ajax request returns ‘Array’. How to output the actual results?
- Ajax load more button for comments wordpress
- Slick + PHP + ACF + JQuery slide reveal not working
- How to add a do_action on refreshing of WP customizer?
- Gravity form built in Captcha
- Menu jumping when calling it via PHP
- Setting value of session with Ajax not working
- Click a radio button must set textfield value
- WordPress Multiple Navigation bars
- [jQuery]Adding shortcode
- multiple taxonomy select display only one in front end
- Display parent and child taxonomies in separate drop down select fields
- Show success or error messages in Ajax response to WordPress custom registration form
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Add / Update Custom Fields After Select Pictures in Media Window
- Post repeating with infinite scroll
- How to prevent plugins from loading jQuery
- Plugins not working on AJAX requests
- WordPress Scripts Being Loaded in Footer
- Fancybox type popup window that’s not an iframe
- How to disable controls in theme customizer?
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- JQuery calling a Custom PHP function (Works in Dev but not in WordPress)
- Form Security: nonce vs. jQuery
- How do I Import / Upload Files with jQuery AJAX?
- WordPress admin-ajax.php 400 bad request
- jQuery code not working when included in functions.php
- Cannot enqueue jQuery correctly using Google CDN
- Why does wp_head hook my functions to the beginning of my source code?
- WordPress Ajax Call inserting data but success response false
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- Ajax contact form return 0
- Conditional Javascript based on WP Version
- How can i display a jquery slide on front page
- AJAX – Returning Two JSON Objects with One PHP Function
- Pull GetOption() variable into jQuery dynamically created html
- Is the wp_enqueue method efficient?
- Royalty-Free Sliders used in theme development
- Convert WordPress date format to jQuery UI Datepicker format
- Correct way to enqueue page specific CSS file
- Error – ‘create_function is deprecated’ [closed]
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- WordPress error when replacing local jQuery by externally-hosted
- Unset session variable on page reload / setup but exclude AJAX
- Tell WP register script to load a script only when the entire page is loaded
- Add Ajax Hooks and Call from Custom Template PHP
- WordPress Ajax Always returning 0
- Is it save to use eval for a jQuery callback method coming from the database?
- linking stylesheets and scripts with functions.php
- Jquery window.send_to_editor function
- Trying to prepend a Hashtag symbol to the_tags links [closed]
- Flexslider won’t work on WordPress
- Function won’t run onclick using Ajax
- Javascript not loading on certain page
- Theme not calling Jquery properly
- How to keep track of when a vote is cast?
- WordPress plugin admin page – using WordPress function in linked php file
- How to add drag and drop functionalities to a div inside option panel
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- How to make jquery count down timer function manually editable
- How to use wordpress function wp_enqueue_script() in php?
- A $_POST should occur when submit form but is not?
- Enqueing External JS on the remote server JS
- My jQuery Ajax form submit is still refreshing page?
- jQuery Ajax PHP function call returning [object Object]
- How to use the wpsnonce clone post link?
- Shortcode to pull posts
- Ajax search shows all results when user empties input?
- Why i can’t get custom fields value or post ID via Ajax?
- Trying to enqueue script – Nothing Happens
- Output votes to div dynamically in wordpress
- Get uploaded image and attach it to the new post
- Admin-ajax php not working on new wordpress version
- url_to_postid returns 0
- How to add post thumbnail dynamically using Jquery?
- Proper way to use WordPress function with AJAX PHP file
- calling function in external js file
- jQuery plugin not loading
- jQuery accordion menu
- JS file is not loading when i put wp_head() and wp_footer
- Enqueue script: link not working in page source
- Live search from database table
- How to refresh a page from jquery [closed]
- Angular not defined [closed]