Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
Last active January 4, 2016 00:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuadavidnelson/8543278 to your computer and use it in GitHub Desktop.
Save joshuadavidnelson/8543278 to your computer and use it in GitHub Desktop.
Exclude scripts from Scripts to Footer plugin, place them back into the wp_head
<?php
/**
* Exclude scripts from Scripts to Footer plugin
* http://wordpress.org/plugins/scripts-to-footerphp/
*
* In this example, we will use jQuery (hosted on Google's servers even)
*/
add_action( 'wp_print_styles', 'jdn_deregister_scripts', 100 );
add_action( 'wp_head', 'jdn_head_scripts' );
function jdn_deregister_scripts() {
wp_deregister_script( 'jquery' ); // The slug or name used to enqueue the script
}
function jdn_head_scripts() { // The html for the script that will be placed in the header
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment