I tried all the solutions I found on the internet, including the ones I found here, but nothing works on my theme - jQuery always load in header. I try to use the one from Google, but I would be happy to use the local one too, only in footer. This is what I have now:
function my_init() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js?ver=1.10.2', false, '1.10.2', true);
wp_enqueue_script('jquery');
// load a JS file from my theme: js/theme.js
//wp_enqueue_script('my_script', get_bloginfo('template_url') . '/js/theme.js', array('jquery'), '1.0', true);
}
}
add_action('init', 'my_init');
Any ideas why no solution works for me?
wp_footer()
defined in the footer, right? – Mayeenul Islam Feb 25 '14 at 1:12