Created
July 18, 2012 16:57
-
-
Save sta1r/3137449 to your computer and use it in GitHub Desktop.
Removing Wordpress plugin scripts and styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove plugin CSS & JS */ | |
/* Next Gen Gallery */ | |
function dequeue_nextGen_style() { | |
wp_dequeue_style('NextGEN'); | |
} | |
add_action('template_redirect', 'dequeue_nextGen_style'); | |
function dequeue_nextGen_js() { | |
if (!is_singular()) { | |
wp_dequeue_script('ngg-slideshow'); | |
wp_deregister_script('jquery-cycle'); | |
} | |
} | |
add_action('template_redirect', 'dequeue_nextGen_js'); | |
/* Contact Form 7 */ | |
function deregister_ct7_styles() { | |
wp_deregister_style( 'contact-form-7'); | |
} | |
add_action( 'wp_print_styles', 'deregister_ct7_styles'); | |
function deregister_cf7_js() { | |
wp_deregister_script( 'contact-form-7'); | |
} | |
add_action( 'wp_print_scripts', 'deregister_cf7_js' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment