Skip to content

Instantly share code, notes, and snippets.

@sta1r
Created July 18, 2012 16:57
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 sta1r/3137449 to your computer and use it in GitHub Desktop.
Save sta1r/3137449 to your computer and use it in GitHub Desktop.
Removing Wordpress plugin scripts and styles
/* 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