Skip to content

Instantly share code, notes, and snippets.

@incidunt
Created February 28, 2019 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incidunt/f08e635650d38db40881464fa04e3a83 to your computer and use it in GitHub Desktop.
Save incidunt/f08e635650d38db40881464fa04e3a83 to your computer and use it in GitHub Desktop.
/** 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