Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6243
    vaindil
    Participant

    I have a bunch of galleries for which I want the gallery to be enabled by default, and I have one gallery that I want it completely disabled (it’s a collection of images that are supposed to link to other pages on the site). How can I either a) disable overall and manually enable on the galleries I want, or b) enable overall and disable on the galleries I don’t want?

    #6251
    Bartosz
    Keymaster

    Tricky question. First I thought it’s not possible but…

    1. Enable lightbox for galleries.
    2. Find the page/post ID where you’d like to disable the gallery
    3. use rl_lightbox_args() filter like that:

    function df_disable_galleries_on_specific_pages($args) {
    	// 12 is the page ID you'd like lighbox galleries to be disabled
    	if (is_page(12)) {
    		$args['activeGalleries'] = false;
    	}
    	return $args;
    }
    add_filter('rl_lightbox_args', 'df_disable_galleries_on_specific_pages');
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.