In a plugin, you have hook add_action( string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1 )
to enqueue script and CSS. In this hook, there is third parameter $priority
you can add the lowest priority to load that hook earlier in execution. So you have 2 options:
- So if you do not have $priority added for plugin hook, it is 10. So you can add the higher priority for theme’s hook. OR
- You can add the less priority that 10 to plugin’s hook.
This Priority option will work for you to load the script/css. for more information you can visit here: https://developer.wordpress.org/reference/functions/add_action/
Note**: Make sure plugin or theme update will not override this thing.
Related Posts:
- Override theme style with other CSS on a specific page
- jQuery dialog popup
- How to change the text of a button in jQuery?
- jQueryUI dialog width
- How to use radio on change event?
- Form Submit jQuery does not work
- Slide right to left?
- Check if user is logged in using JQuery
- How to save the state of a drag and drop jQuery UI Sortables front end layout editor?
- jQuery UI Datepicker not working
- Custom function to rearrange attachments when creating posts – Almost there
- Add `datetimepicker` to form
- possible to make sections in theme customizer sortable and saveable at publish button clicked?
- Enqueuing jQuery in plug-ins
- How do I get my page to load the jQuery UI Effects library?
- Using multiple versions of jQuery while still calling it like WP likes
- Override default jquery ui library with newer version
- How to enable the content editor as a droppable target with jQuery-ui?
- Automatic jQuery accordion from header tags
- Jquery not showing in homepage
- Format numeric symbols in titles
- jQuery.accordion isn’t a function even when enqueued
- Will the latest Bootstrap work properly with the default WordPress jQuery?
- Rhyzz Repeatable-fields javascript in php and wordpress
- WordPress + BlockUI or a splash page [closed]
- Return an array from get_terms and store as JavaScript array for search autocomplete
- Dukapress jQuery(“form.product_update”).livequery is not a function [closed]
- Which jQuery packages are included in WordPress 3.1.2?
- Good Solution for Adding jQuery Tabs Anywhere Within WordPress?
- Cannot enqueue jQuery correctly using Google CDN
- Adding jQuery UI elements to WordPress page
- Sorting WP Auctions by date/price?
- How to add custon UI jquery & Fancybox script to WP
- jQuery tabs plugin with callback to fetch data
- Jquery UI Google CSS, from where?
- datepicker for custom post type admin
- JQuery UI not loading without explicit loading of jQuery
- Is there a default way in wordpress to create a overlay in the dashboard?
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- Recommended Use of Bootstrap, or JQuery-UI in WP/plugin development?
- Screen Options JavaScript Code
- Drag and Drop Metadata Menu Order
- A carousel slideshow plugin in JavaScript
- jQuery UI Accordion loading very slow
- Slide toggle Jquery UI
- jquery Autocomplete
- why does so many javascript libraries are loaded along with my website?
- Dashboard controls have all stopped working
- How can I add a new lib path without call each one on the header?
- Sorting UL Listing Within the TinyMCE Visual Editor in WordPress
- jQuery dialog prints HTML-Tags under WordPress
- using jquery autocomplete in wordpress plugin
- Theme variation conflict with jquery select2 dropdown
- javascript and css not loading properly in WordPress site
- jQuery datepicker not showing on admin menu
- JSON parsing error syntax error unexpected end of input
- check / uncheck checkbox using jquery?
- Change Placeholder Text using jQuery
- $(document).on(“click”… not working?
- how to loop through JSON array in jQuery?
- jQuery get the image src
- I want to enqueue a .js file to my child theme
- How to prevent WordPress from loading the jQuery library at the top of the page
- Adding jquery and thickbox to WordPress theme
- WooCommerce single product edit flexslider settings
- jquery & ajax getting data to php in wordpress
- AJAX returns response 0
- WordPress Featured Post Slider
- Unable to run jQuery script in my template file
- validate a metabox based on the category that is selected
- wp_mail very slow
- Unable to uncheck checkbox with jquery in wp admin
- Adding a slider captcha to the comment system
- WordPress AJAX Load More function duplicating a post
- Plugins loading multiple copies of JQuery
- How to wp_enqueue_script jQuery inside a Plugin
- jQuery accordion plugin won’t work once used in WP
- Why use admin-ajax.php when loading pages through AJAX?
- change order of add_action hooks for jquery to be loaded first
- Can’t delete the default jQuery in the theme
- WordPress jQuery crash [closed]
- Conditional Tags – Multiple Categories
- Using Jquery submit with ajax request
- ajax not working in plugin
- wp not defined at wp.Uploader.prototype
- How to update WordPress jQuery version?
- How to enable read more by default using jquery
- Show More Show Less – Not Working
- how to allow download after newsletter subscription?
- How to use jQuery plugin
- Passing variable data from external jQuery file to options.php
- Custom Javascript not working? [closed]
- Ajax autocomplete based on usercode
- Jquery script not loading on site Front page
- Get selected value with PHP and jQuery
- Javascript block in Twenty Twelve theme
- How to combine jQuery in-place editor with $wpdb->update
- Does anyone know how to load jquery in the footer?
- Use WordPress Built In Jquery
- Can’t seem to check off a category checkbox with jquery?