How to use wp_enqueue_script() in WordPress Theme Footer
WordPress wp_enqueue_script() usage
<?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?>
Themes developer commonly use WordPress wp_enqueue_script() in their theme’s functions like this
wp_enqueue_script('html5shim', '//html5shiv.googlecode.com/svn/trunk/html5.js', array('jquery'), '1.1' );
but this code always put the scripts before end </head> and not in the footer.
In this post, you’ll learn how to use wp_enqueue_script() in WordPress Footer. Just edit your current wp_enqueue_script() like above code to new code like this:
wp_enqueue_script('html5shim', '//html5shiv.googlecode.com/svn/trunk/html5.js', false, '1.1', true );
as you can see the code are much different than the first one. i removed the array(‘jquery’) handler and set $in_footer to ‘true’.