You should be using wp_register_script()
and wp_enqueue_script()
, so, for example:
add_action( 'wp_enquque_scripts', 'my_script_enqueue' );
function my_script_enqueue() {
wp_enqueue_script( 'my-jquery', 'URL TO THE FILE', array( 'jquery' ) );
}
Also, as mentioned by Zack, you should be registering your jQuery as such, as wordpress does not use $
for jQuery by default.
jQuery( document ).ready( function( $ ) {
//your jquery
});
Related Posts:
- How can I make my custom shortcode work in a Custom HTML Widget?
- Editor not displaying dynamically after clicking on the button
- Add jQuery to WordPress page
- jQuery function didn’t work in my plugin
- how to include a simple jquery file into a wordpress plugin
- Pass a php string to a javascript variable
- How to trigger $_GET request within admin plugin page?
- How can I get WordPress to save comments in markdown format?
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- Notepad sticky plugin
- Adding a slider captcha to the comment system
- How to put JQuery/Ajax inside shortcode?
- Error with Image Slide plug-in/ s3slider in WP
- wordpress site | All-in-one-cufon IE Issue
- WordPress function not being called from jQuery method
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- How to insert HTML/JavaScript form into WordPress page? [closed]
- How to prevent plugins from loading jQuery
- Using color picker in plugin, does input attribute order matter?
- Using window.onload with Ubermenu
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- wordpress add_action() issue in ajax call
- Adding media upload button to User Profile page (following a tutorial)
- How can I exclude a dynamic URL to show a popup created using ‘WordPress Popup’ plugin
- JQuery prepend a function
- Is there a function to list all uploaded images? How can I add one?
- Any idea how to get something like this to work? [closed]
- Is there a way to convert shortcodes to html content?
- the_content() printing DOCTYPE, and tags in the middle of page
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- Save user total active time after login in wordpress [closed]
- Api external with wordpress
- File Uploader – Upload without adding to Media Library
- Wierd site output [closed]
- Custom meta box with jQuery.sortable custom post type list
- Code for unique user visit count on every page WordPress
- How do I reinit WordPress plugins dynamically using jS?
- WordPress jQuery Post – Amending Variable Value Within Function Command
- Overriding inline !important CSS with Javscript code snippet with media query
- WP Ajax DB issues
- How to get a specific string from a url
- How to translate to spanish wordpress hardcoded content/files?
- How to change a wordress plugin php code in my child’s functions.php file?
- update_post_meta is not working for me when I use e.preventDefault for update button
- make p tag collapsed after 3 rows
- Why is my form going to frontend on html form submission present on the php files inside my custom plugin?
- How To Toggle User_Meta in frontend in a form using PHP
- Scroll to ID broken in main menu
- Get and Update Most Meta Value as an array in HTML form
- Can’t access 3rd party API, code works on local server but not on wordpress
- How to echo a PHP Code After the Content
- Help with customising love it plugin (use within foreach)
- How to remove a css class for any wordpress page
- Form tries to download a file on submit
- Add HTML between feed items
- Adding link on title its in description but not in title see screenshots attached
- AJAX doesn’t pass variables to the php function in the plugin
- What is the process for reimplementing a back up WordPress?
- Possible jquery / library conflict in plugin usage
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- PHP and Jquery pass value from form. Update function on DataBase
- Plugin use of ajax/jquery depending dropdown
- How do I output user_registered time in my correct timezone?
- Element works, but not on wordpress site [duplicate]
- wordpress illegal string offset ‘parameter’ error
- wordpress jquery is not defined because the head tag is empty
- Need help with wordpress audio preload
- Option value not getting updated until page refresh in WordPress
- Limit entry to a WordPress page
- How to create a “Most Popular” & “Latest” TAB in WordPress
- How to fix template and image buffering issues on website [closed]
- How to create different woocommerce single_product.php pages for each product? [closed]
- WP showing “warning: call_user_func_array()”, What to do?
- How can I pass a variable to wp_ajax action?
- How can i change an image’s author?
- Plugin for a text modal box [closed]
- Creating custom HTML pages
- Time consuming callbacks in customizer
- How can I add hyperlink in WP_Error message?
- Frontent user submit and view content [closed]
- Center and hide overflow of WP toolbar custom links
- Duplicate results are displayed in a custom plugin [closed]
- How to best create a jQuery Slider to display a native wordpress gallery?
- Help with WP Business Directory Manager Plugin?
- I receive taxonomy id
- Loop in elementor custom widget not working
- Change text string in a plugin
- How to change WooCommece variation data programmtically [closed]
- How to include files relative to a file’s directory
- FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed
- FacetWP breaks jQuery events
- How do I display PHP file contents on front end of WordPress?
- jQuery Ajax not loading page with ACF fields
- SimpleXML is not working with xml response from external api
- No result after wpdb->insert
- Plugin program: JQuery not working in this plugin
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Creating a Table Row by Row
- Getting 504 Gateway Timeout Error on AWS Server! [closed]