What the exact meaning of the last parameter of wp_enqueue_script()?
-
I want to know the exact meaning of the last parameter of wp_enqueue_script() function.
The prototype is as follows: wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
It seems to decide where to load the script: in head or footer? But
When I wrote:
<?php wp_enqueue_script('jquery', '', array(), false, true); <?php wp_head(); ?> ... <?php wp_footer(); ?>
jquery is inserted in the head.
when I wrote:
<?php wp_head(); ?> ... <?php wp_enqueue_script('jquery', '', array(), false, true); <?php wp_footer(); ?>
the jquery is inserted in the footer.
And no matter the last parameter if true or false, the result is the same!
It really puzzled me.
Thank you for any suggestion.
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘What the exact meaning of the last parameter of wp_enqueue_script()?’ is closed to new replies.