Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I use nextgen gallery in a multisite. How can I disable all scripts and styles? These thing are loaded in the code of my site:

<link rel='stylesheet' id='NextGEN-css'  href='http://mysite.com/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0' type='text/css' media='screen' />

<script type='text/javascript' src='http://mysite.com/wp-content/plugins/nextgen-gallery/js/jquery.cycle.all.min.js?ver=2.9995'></script>

<script type='text/javascript' src='http://mysite.com/wp-content/plugins/nextgen-gallery/js/ngg.slideshow.min.js?ver=1.06'></script>

<!-- <meta name="NextGEN" version="1.9.7" /> -->
share|improve this question

1 Answer

up vote 1 down vote accepted

This takes care of NextGEN's slideshow and CSS, as well as the Shutter script and CSS that it also enqueues by default.

add_action('wp_print_scripts', 'wpse_82982_removeScripts');
add_action('wp_print_styles', 'wpse_82982_removeStyles');

function wpse_82982_removeScripts() {
    wp_dequeue_script('ngg-slideshow');
    wp_dequeue_script('shutter');
}

function wpse_82982_removeStyles() {
    wp_dequeue_style('NextGEN');
    wp_dequeue_style('shutter');
}

But: are you sure you want to do that? Maybe you can be a little selective, and only do that on selected pages / posts / categories.

Edit: to remove the commented-out meta tag too, add this filter:

add_filter('show_nextgen_version', '__return_null');
share|improve this answer
i use with Justified Image Grid - Premium WordPress Gallery , so the js and css of nextgen are useless now. Also, if i wont to this action in all of my sites in my multiste what is the code for wp-config.php? – Alex Jan 24 at 11:31
1  
I'd suggest you create a minimal plugin, then you can easily drop it into any site without modification. – webaware Jan 24 at 11:34
ok, thnx a lot :) – Alex Jan 24 at 11:37
Something last, do you know how can i remove and this <!-- <meta name="NextGEN" version="1.9.10" /> -->? – Alex Jan 24 at 11:42
1  
@Alex: see updated answer – webaware Jan 25 at 12:19
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.