WordPress jquery hosted on top

in all my wp projects im include jq script in footer like that:

wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', get_template_directory_uri() . '/js/jquery2.1.js', array(), false, true );
wp_enqueue_script( 'jquery' );

ofc this is add_action to wp_enqueue_scripts. But in one of project i see – jq included in top of page. Strange, i set last param to true, it means – footer.
What is thing forced my jq jump to top ?

Read More

Note: if i set another script name (not jquery) this script returns to regular placement behavior(depends on settings ofc)
why scriptname “jquery” do this?

Related posts

Leave a Reply

1 comment

  1. Look on your HTML source code to see what javascript files are directly beneath it. If a plugin’s javascript file that is enqueued to the header is set to require jquery, then jquery will be loaded prior to that javascript file.