I have noticed if I move all of my javascript to the footer, some plugins do not function properly, or at all. Is there some code I can add to my functions.php to move specific plugin javascript to the footer? Or is there a way to exclude certain js from going from the footer if I add it all?
This is the code I used:
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
function my_remove_thematic_scripts() {
remove_action('wp_head','thematic_head_scripts');
}
add_action('init', 'my_remove_thematic_scripts'); //wait for init
//Add the actions to the footer
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer','thematic_head_scripts');
add_action('wp_footer', 'wp_print_head_scripts', 5);
The plugins that don't work properly are simplemap, gravity forms (mainly not loading properly) and a background slider for my homepage.