Edit: new solution, based on one of the comments. If you are using wp_enqueue_script
to load your js file, make sure jQuery
is a dependency so that it gets called before your code:
wp_enqueue_script( 'my_script', 'my-script.js', array( 'jquery'), $ver, true );
You can then remove the original enqueue call you had since jQuery
will be included automagically
Related Posts:
- force enqueue script to be first in order of prominence
- How do I force wp_enqueue_scripts to load at the END of ?
- WordPress Enqueue Script Chaos (jQuery & Foundation.js)
- How do I make sure a plugin loads a script after jQuery
- Calling JavaScript file with Custom Plugin
- Problem in loading javascript in footer
- jQuery for custom plugin not working with Divi theme
- Create shortcode to echo javascript
- Enqueue script: link not working in page source
- sliding/fading header plugin or approach suggestion
- How to install jquery dotdotdot plugin for WordPress?
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- Redux Framework: Page freezes on typing in Editor
- How can I inject options into an select tag inside the widget form?
- jquery tinymce and bundled wp plugins
- Display wordpress post’s in popup?
- How to prevent plugins from loading jQuery
- Using color picker in plugin, does input attribute order matter?
- JQuery plugin that works with Google 1.10.2 and not with WordPress 1.10.2
- Loading a purchased jquery plugin in a wordpress theme
- Using window.onload with Ubermenu
- Post Comments with Ajax in WordPress
- jQuery | JJ Carousel Plugin – Can’t set speed [closed]
- Object method calling for global $wpdb in header.php
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Integrating jQuery Datatables with Editor into wordpress admin
- how to insert data in wordpress table usnig jquery ajax
- Stop WordPress processing Javascript as text
- What does making sure “that your theme is WordPress header and footer tag enabled” mean?
- Jquery plugin not working on single pages
- Jquery NoConflict Problem
- Know which plugin is calling JS in wp_head()?
- this jQuery function works perfect in static html page but not on wordpress
- How to include this jQuery File in wordpress?
- Is there a loading priority for login_enqueue_scripts?
- My single.php page does not show the related data to the post which is clicked
- Enqueue stylesheet in plugin for wp-login.php
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- “Conflict” with jQuery (or its plugins)?
- How does one include the JQuery UI plugin to wordpress and enque it correctly in a plugin form?
- a weird attribute on every html tag
- Why am I unable to load scripts in head in plugin?
- How to add an element right after the article using jQuery?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Deactivate JS Script in Plugin Shortcode
- How to track clicks
- Remove / overwrite some functions in buddypress.js
- wordpress add_action() issue in ajax call
- Remove Yoast jQuery from front end
- How to display checked posts on another page over AJAX? (like comparasion style)
- Adding media upload button to User Profile page (following a tutorial)
- Localizing methods for jQuery append prepend wrap parent
- JQuery prepend a function
- Register google jquery gets overwritten by plugin
- Get ‘Headers already sent’ error for the plugin I am creating when I try to login
- Custom Login Page — wp_signon Headers Already Sent?
- Is there a function to list all uploaded images? How can I add one?
- How to best create a jQuery Slider to display a native wordpress gallery?
- How to remove js ui library added by default by wordpress
- Adding Plugin Assets to Header
- Add type to enqueued script inside plugin
- I changed .live() to .on() but change is not reflected on the server
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- wp_dequeue_script for a Plugin
- Creating a widget and missing jQuery
- Stop wordpress from requesting external jquery from googleapi
- echo get_option in header template
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- Save user total active time after login in wordpress [closed]
- Opening a JQuery modal window on click of a button with a JQuery plugin
- Custom plugin – load enqueue only for this plugin
- Api external with wordpress
- Why does my jQuery plugin show up as text in WordPress?
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- How do I make sure that my plugin only runs on article detail pages?
- Disable submit button order
- Why do I get jQuery reference error / undefined when changing name of plugin file?
- Deregister scripts from plugin
- Custom meta box with jQuery.sortable custom post type list
- How to include my Ajax calls in one function instead of calling different ones every time?
- How to prevent tabs from opening all at once
- Why jquery option is not working when pass value using wp_localize_script?
- Custom CSS not being added by plugin
- Load CSS files in header of Bones theme?
- jQuery code didn’t run on my plugin
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- Cannot access WP admin because plugin returns 204
- why the wp_register_script doesn’t work for register_activation_hook
- “switchEditors is not defined” with wp_editor() in jQuery UI tabs
- Separate jQuery for Individual Comments?
- How to enqueue some javascript source once per page
- FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed
- Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs
- jQuery(‘#news-ticker’).cycle is not a function
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- Using AJAX to run SQL statement and populate dropdown
- Edit page header on a custom plugin
- How do i ‘deactivate’ a plugin only on a certain page template?