In this file
wp-include/script-loader.php
Have this code:
$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.11.3');
$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.11.3');
$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1');
How do I put the jquery in the footer?
I’ve tried adding a fifth parameter “true” or “1”, but does not work.
...
* Localizes some of them.
* args order: $scripts->add( 'handle', 'url', 'dependencies', 'query-string', 1 );
* when last arg === 1 queues the script for the footer
...
I want to put the jquery at the bottom because it is blocking the correct page load (google page speed recommendation).
You have to dequeue it first and then enqueue it again.
The following code will do exactly what you need.
After experiencing all these problems and testing workarounds myself without any joy, I decided to just migrate all scripts in one go.
So how about going one better and having some code that loads all your script files, present and future into the footer. Preventing this ballache from repeating. Also handy for any plugins you may add.
Open your functions.php file and add this bad boy
Cf docs: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts
You have a hook: wp_enqueue_scripts
Use: