‘Bones’ theme: Load stock scripts in footer instead of header?

Most of the JavaScript listed looks like it belongs to the nodes.tmp plugin and not the actual Bones theme. There’s not much you can do about that unless you use wp_deregister_script to disable the scripts and then load them again in footer. This can get messy fast and can cause issues when the plugin is updated. If you’re interested in doing it still, there’s a good article about how to disable plugin scripts and styles.

The Bones theme looks like it is already loading it’s scripts in the footer:

//adding scripts file in the footer
wp_register_script( 'bones-js', get_stylesheet_directory_uri() . '/library/js/scripts.js', array( 'jquery' ), '', true );

The true argument at the end is saying to load the script in the footer. Have a look at the codex page for wp_register_script for more info.

The following will move jQuery to your website footer. However you need to be mindful that this will most likely break plugins if they load scripts in the website header. There’s a check in the code to ensure that jQuery isn’t moved in the admin and theme customizer.

function themename_print_jquery_in_footer( &$scripts ) {
    // Return if the website is being requested via the admin or theme customizer
    global $wp_customize;
    if ( is_admin() || isset( $wp_customize ) ) {
      return;
    }

    $scripts->add_data( 'jquery-core', 'group', 1 );
    $scripts->add_data( 'jquery-migrate', 'group', 1 );
}
add_action( 'wp_default_scripts', 'themename_print_jquery_in_footer' );