Skip to content

Instantly share code, notes, and snippets.

@JLeuze
Created May 24, 2012 15:52
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 JLeuze/2782356 to your computer and use it in GitHub Desktop.
Save JLeuze/2782356 to your computer and use it in GitHub Desktop.
Plugin to remove JS and CSS for Meteor Slides when not on homepage
<?php /*
Plugin Name: Remove Meteor Scripts
Description: Remove JS and CSS for Meteor Slides when not needed.
Author: Josh Leuze
Author URI: http://www.jleuze.com/
Version: 1.0 */
add_action( 'template_redirect', 'disable_meteorslides_scripts' );
function disable_meteorslides_scripts() {
//Removes actions for scripts when not on frontpage, change conditional as needed: http://codex.wordpress.org/Conditional_Tags
if ( !is_front_page() ) {
remove_action( 'wp_print_scripts', 'meteorslides_javascript' );
remove_action( 'wp_enqueue_scripts', 'meteorslides_css' );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment