• Resolved tagaeri

    (@tagaeri)


    Hi,
    Great plugin! But I only need it running on a few pages. I thought there was a way to disable the script on a page by page basis, but I don’t see that option anywhere in WP Admin or on post/pages screens. Also, is there are way to disable it by default on all posts/pages, and then just turn it on for the posts/pages I need it?
    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Robert Neu

    (@fatmedia)

    Hey tagaeri,

    There should be a checkbox to disable the plugin inside the publish box on the post edit screen.

    Publish box

    There is no way to bulk disable the plugin from the UI, but you could do it from within your theme. You can disable the CSS and JS from running on the front end using some filters built into the plugin:

    If you wanted to do that conditionally, you could wrap it inside a callback like this:

    add_action( 'wp_enqueue_scripts', 'prefix_maybe_disable_featherlight', 10 );
    /**
     * Remove all required scripts and styles on most pages.
     *
     * @access public
     * @return void
     */
    function prefix_maybe_disable_featherlight() {
    	if ( ! is_page( 'whatever' )  ) {
    		add_filter( 'wp_featherlight_load_css', '__return_false' );
    		add_filter( 'wp_featherlight_load_js',  '__return_false' );
    	}
    }

    I hope that helps!

    Thread Starter tagaeri

    (@tagaeri)

    Ah, great – I couldn’t find the checkbox, but I see it now, thanks.

    I’m not much of a coder… Does the code you provide go in style.css? Will it disable the plugin by default, and then I’ll uncheck the checkbox on the post screen for each post/page I want to use the script on?

    Thanks!

    Plugin Author Robert Neu

    (@fatmedia)

    No, that code would override the checkbox option and it would be placed in your themes functions.php file.

    Unfortunately, without a little bit of code experience it’s probably going to be difficult for you to set up the conditions you want to use when deciding whether or not to display the lightbox.

    If you’re looking for a plugin with more user-facing options, take a look at FooBox. It might be a better fit.

    Thread Starter tagaeri

    (@tagaeri)

    OK, thanks. Is the script small enough to leave running on all pages then?

    Plugin Author Robert Neu

    (@fatmedia)

    In my opinion, you should be fine loading it site-wide. Our entire script is only 13k minified and loads in the site footer, after all of your other content.

    If your page has even one image on it, that should be significantly larger than the payload from Featherlight, so I think it’s probably not worth worrying about too much from a performance standpoint.

    Thread Starter tagaeri

    (@tagaeri)

    OK, great – thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Bulk disable plugin’ is closed to new replies.