Don’t load jQuery that way. It comes built into WordPress, so what you really want to do is tell WordPress that (1) your Javascript file should be loaded, and (2) it relies on jQuery being loaded. You do this with wp_enqueue_script.
So put this in your functions.php file, replacing the path in quotes with the path to your (jQuery-dependent) Javascript file in your theme:
function my_jquery_script () {
wp_enqueue_script ('my-jquery-script', get_template_directory_uri () . '/js/my-jquery-script.js', ['jquery'], '1.0', true);
}
add_action ('wp_enqueue_scripts', 'my_jquery_script');
Related Posts:
- How to set time delay in javascript
- Disable button in jQuery
- JavaScript: filter() for Objects
- Is jQuery $.browser Deprecated?
- jQuery date formatting
- $ versus jQuery
- How to center image in carousel
- Enable & Disable a Div and its elements in Javascript
- jQuery dynamic selector
- How to pass $(this) properly in click jQuery function
- How to remove specific value from array using jQuery
- how to remove default jquery and add js in footer?
- CSS not pulling in for jQuery UI dialog
- Lightbox popup on WooCommerce add_to_cart action
- Check if jquery library exist
- Loading style.css and Jquery using HTTPS
- Access Customizer’s DOM – jQuery
- jQuery AJAX form validation
- Media manager multiple selection
- Uncaught TypeError: Cannot read property ‘replace’ of undefined
- Is it worth updating WP admin to jQuery 1.5?
- How to include jQuery properly?
- How to load whole WordPress pages dynamically with AJAX/jQuery like this following website?
- Adding jQuery dependency prevents my script from enqueuing/loading
- Creating custom AJAX requests
- How to pass jQuery ajax URL value
- trigger(‘change’) not working
- how to get the comment ID in the front end when the REPLY button is clicked?
- Gravity list field override and adding javascript [closed]
- Change header image loaded by jQuery to use HTTPS
- Admin wp_ajax hook returning 0
- Need To Deregister Scripts Via Functions.Php
- Add a Fancybox automatically to post type “post” images
- enqueued script with jquery dependency not getting jquery
- Uncaught TypeError: jQuery is not a function
- WordPress customizer refresh screen after save
- Creating multiple enclosing shortcodes and fixing JS issues on click
- Include jQuery plugin in WordPress
- Hide metabox dependant on page template chosen
- Trying to remove duplicate jquery scripts
- How to make an WordPress element sticky? [closed]
- I want to import my Json file into a custom made display-modal. How do i link my Json file?
- Frontend Post with JQuery AJAX to Php Issue
- show/hide div with simple jQuery script [closed]
- How do I remove WordPress Custom Menus hover event and replace it with jQuery onclick?
- How to get all users by custom current user meta (array)?
- wp_dequeue_script not working in my plugin
- Trouble adding inline style after jQuery in the footer!
- jQuery script isn’t posting to database
- $.browser Undefined Seemingly Causing Faulty Page Display
- I’m trying to set the cookie to my site to button on click action ,it is working on when user logged in .When user logged out it’s not working
- Do I need to use jQuery for my template?
- Loading scripts on a single page plants the script in the footer
- registering new jQuery after wp_deregister_script() not working
- jQuery Show DIV and Remove Button [closed]
- timeouts (ERR_CONNECTION_RESET) on seemingly random files after upgrading to HTTPS
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- No Object Properties sending form through AJAX
- Redirect wp_dropdown_pages() to an AJax request?
- click event to unhide something after ajax not firing
- how to use wp_editor() here am getting empty result
- jQuery is not defined, working on local server but not online
- Parse wordpress blog data using json api and ajax
- JQuery Issues With WordPress Theme Interface
- problems with jquery external rss feed integration
- wp_enqueue_script calling jQuery at different times for different browsers?
- AJAX calendar navigation returns -1
- A carousel slideshow plugin in JavaScript
- Axis guidelines over an image
- Retrive username of the loged in user using jquery
- How to setup multi-page using jquery?
- $ not defined using jQuery in WordPress
- Get with jQuery the value of an ACF field
- I want to run Sql Query in script how can i do this
- error: n.imagesLoaded is not a function
- WordPress forbidden 403 on delete in production vs local environment
- How to change event in slider
- Get ajaxForm response value
- Update a parent theme JQuery property in the child theme
- Adding scripts before plugins scripts
- jQuery search function not running in WordPress but running locally (fiddle)
- Refresh widget admin page resetting jQuery hidden class
- Autocomplete for titles via ajax – rework of past post away from like_escape()
- Can’t seem to get JQuery working (wordpress plugin)
- Ajax Request with jQuery not happening
- Console shows ReferenceError: jQuery is not defined, no clue why!
- slide change on hover with nextgen scrollgallery [closed]
- Sorting UL Listing Within the TinyMCE Visual Editor in WordPress
- How to make jQuery load AFTER plugin’s script?
- jQuery not working internal pages [duplicate]
- jQuery .change() Event Bubbling in WP Admin
- My .js file is getting a 404
- Unable to understand this jquery code [closed]
- Combo box populating a DIV using ajax/jquery
- Accessing Advanced Custom Fields with Repeater using jQuery instead of PHP
- How to Add jQuery cod in wordpress [duplicate]
- can’t make jQuery work (change image on time interval) [closed]
- Generate dynamic ID’s for each accordion button
- Impossible to update jQuery version from 3.1.0
- Enqueued jQuery not working