• I have a custom PHP page and parts of it does not work due to conflicts with other jQuery libraries (at least that’s what I see thus far).

    If I deactivate NextGen then the custompage works just fine.

    So my question would be is there a method to disable the NextGen plugin from loading on certain pages?

    I know there are plugins to disable plugins but I don’t want to use a plugin. I’d prefer something like a hook with no core modifications.

    Thanks.

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @sfgolfer – There is no current method to disable NextGEN Gallery and/or not load its scripts for a specific page / post.

    Our current option is to define NGG_SKIP_LOAD_SCRIPTS but that may become quite cumbersome to implement on a page-by-page basis.

    Please feel free to suggest this as a Feature Request here: http://www.nextgen-gallery.com/feature-voting/

    Thanks!

    – Cais.

    Thread Starter SFGolfer

    (@sfgolfer)

    Well, through some blind luck, I was able to achieve my goal of having NextGen still work in the posts but have it “not work” on a single page.

    Pasted this into functions.php

    function disable_nextgen($content) {
        if (is_page('Name of Page')) {
    	define('NGG_SKIP_LOAD_SCRIPTS', TRUE);
            return $content;
        } else {
            return $content;
        }
    }
    add_filter('the_content', 'disable_nextgen', 9);

    How this is able to work is beyond my understanding especially since the NextGen source files (JS, CSS) still gets loaded into the page’s source code.

    Plugin Contributor photocrati

    (@photocrati)

    @sfgolfer – I’m glad things are working for you; and, I agree, I cannot see how that code snippet would be working to sort this out … but I’m not going to question success in this case either (*grin*).

    Let us know if there is anything else … and watch for the effects of that snippet with future updates, too.

    Thanks!

    – Cais.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent NextGen from loading’ is closed to new replies.