Tag Info

New answers tagged


In theory the code you wrote should work, in the practical application you are missing some good practices which it might impact on how your code is working, so it's better run through a bit of troubleshooting to tick off everything from the checklist. By de-registering jquery you are taking away both the jQuery core and the jQuery Migrate javascripts, ...


You are correct that passing false to the wp_register_script function call should ensure the script is placed in the page's header. Do you have any other plugins that may be modifying your scripts' location? For instance, plugins like Autoptimize will try to "intelligently" place scripts in the footer to speed loading when possible.


No 1: you have to put your jquery deregister etc. Stuff into a function that is called with the wp_enqueue_scripts hook. Do it like this: add_action('wp_enqueue_scripts','jquery_2_loader'); function jquery_2_loader(){ //insert your jquery deregister and Register } Second question: many Plugins rely on enqueuing jquery. So if you deregister it, those ...


For my plugin I found that sometimes users have a theme builder that has shortcode stored in post meta data. Here is what I am using to detect whether my plugin shortcode is present in current post or post meta data: function abcd_load_my_shorcode_resources() { global $post, $wpdb; // determine whether this page contains "my_shortcode" ...

Top 50 recent answers are included