Fails to load jQuery script in the Footer
-
Hi,
I still don’t understand why my jQuery script is still loaded in my header section !function update_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery','/scripts/jquery-2.1.1.min.js','',null,true); wp_enqueue_script('jquery'); } } add_action('wp_enqueue_scripts', 'update_jquery');
This is what I checked :
- – The function above is correct (I verified that the code was correct using the WordPress Codex).
- – I tested to remove the above function that deregister jQuery to load the WordPress default jQuery library (in case my function was incorrect).
- – wp_footer() is well present in the loaded file footer.php from my theme files.
- – I tested all the following workarounds to call jQuery in the footer :
- How to enqueue the bundled jQuery in footer – The Right Way
- Getting all JavaScript into the Footer in WordPress ?
Thanks for your support.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fails to load jQuery script in the Footer’ is closed to new replies.