I'm trying to make scripts load in a certain order, and am getting unexpected results. I'm using this script:
function tallulah_scripts() {
wp_enqueue_script( 'header-js', get_template_directory_uri() . '/js/header.min.js', null, '1.0', false );
wp_deregister_script('jquery');
wp_enqueue_script( 'footer-js', get_template_directory_uri() . '/js/footer.min.js', null, '1.0', true );
wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery.min.js', null, '2.1.0', true );
}
add_action( 'wp_enqueue_scripts', 'tallulah_scripts');
...and when I load the page the scripts appear like this:
<script type='text/javascript' src='http://tallulah/wp-content/themes/tallulah/js/jquery.min.js?ver=2.1.0'></script>
<script type='text/javascript' src='http://tallulah/wp-content/themes/tallulah/js/footer.min.js?ver=1.0'></script>
</body>
</html>
odd right? How would I FORCE footer.min.js to load first? I've tried setting the dependency like so:
wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery.min.js', 'footer-js', '2.1.0', true );
..but it seems to have no effect. Any pointers please?