Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/** Remove jQuery scripts loading from header */
add_action('wp_enqueue_scripts', 'genesis_sample_script_remove_header');
function genesis_sample_script_remove_header() {
wp_deregister_script( 'jquery' );
wp_deregister_script( 'jquery-migrate' );
}
/** Load jQuery script just before closing Body tag */
add_action('genesis_after_footer', 'genesis_sample_script_add_body');
function genesis_sample_script_add_body() {
wp_register_script( 'jquery', 'https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js', array(), null, true );
wp_enqueue_script( 'jquery');
wp_register_script( 'jquery-migrate', 'https://cdn.bootcss.com/jquery-migrate/3.0.1/jquery-migrate.min.js', array(), null, true );
wp_enqueue_script( 'jquery-migrate');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.