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]
- Woocommerce attatch files and custom input meta to cart items and then to order
- Multi step form, custom plugin
- Can I check plugins and themes for PHP 5.6 ahead of global PHP server Update
- How make a php script run only with wp-cron
- Most efficient way to use classes to create admin pages using Settings API
- CMB2 toolkit: Compare 2 Dates and validate the Time
- Using TinyMCE in plugin?
- Use wordpress plugin in codeigniter
- Creating a functionality plugin to edit seriously simple podcasting
- Creating an admin meta box to save post as pending
- Passing value as hidden parameter to next page
- Plugin or ways to limit number of users logging in the website,
- Replace old theme that understand old css (vcex_icon_box css_animation)
- How to insert datas in the table on wordpress?
- ACF checkbox return format based on page
- How to get database connection details without longing to cpanel in WordPress?
- Precheck fields when I add a new post
- How to translate wordpress blog to other languages?
- Multiple image selection custom widget
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- Change custom rewrite rule when permalink is updated/changed
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Pulling Advanced Custom Fields from other pages
- Vote It Up Plugin – Add ascending numbers to MostVotedAllTime Chart Function
- How to fix vanilla comments extra iframe space
- How to trigger plugin migration code when plugin updates?
- How to Save Category and Delete Category in same Function