Is there any disadvantage to using wp_footer as the hook when enqueuing javascript files in a wordpress theme? I have about 5 files that I want to be enqueued in the footer but setting the wp_enqueue_script property for footer to true isn’t doing anything.
I have wp_footer() in my footer file and when I change the action to:
add_action('wp_footer', 'extra_scripts');
the scripts load fine in the footer. This is just for a demo and not anything more than just a front end display. Is there anything wrong with doing it this way to load the scripts in the footer?
You should enque what you can in the footer.
To force this use:
This way you can use the default
wp_enqueue_scriptsDo remember that some scritps need to be in the
<head>like the HTML5 script of twentyeleven/twentyten