kingkong954
Member
Posted 2 years ago #
When using wp_enqueue_script I cannot get Jquery to load.
Plugins that attempt to load it also fail.
I have wp_head and as well as wp_footer calls where necessary.
No errors are thrown (by PHP) and it still happens when I disable all plugins.
I am stumped.
Where are you putting your call to wp_enqueue_script? Try adding the following to your theme's functions.php file:
<?php
function my_jquery_init() {
wp_enqueue_script('jquery');
}
add_action('init', 'my_jquery_init');
?>
kingkong954
Member
Posted 2 years ago #
I tried that too -- no luck.
I can place the call before or after the wp_head call.. it doesnt make a difference. No JQUERY is ever loaded.
I load jQuery into a theme (as well as other stuff that I've edited out) with the following with no problem:
function theme_queue_js(){
wp_enqueue_script('jquery');
}
add_action('get_header', 'theme_queue_js');
Its worked through several WP versions so far.
@apljdi, what happen when you enter the dashboard ? is it still working ? Dashboard panel has its own jquery, is it ?
In practice, I filter it out of the admin section with an is_admin conditional. I think there is probably a less hackie way to do it but I haven't come back around to that project yet. I don't that that wp_enqueue_script with load the same file twice though.