Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16144
    flightoffancy
    Participant

    Is it possible to have lightbox enabled everywhere EXCEPT for the home page? I use galleries in a lot of my posts and want those to open in lightbox, however, I want to put a gallery on my home page and want those images to link to the attachment page and not open the image in lightbox.

    #16163
    Bartosz
    Keymaster

    Of course it’s possible.

    Please have a look at these threads: https://dfactory.co/support/search/?bbp_search=rl_

    #16237
    flightoffancy
    Participant

    I tried both of these codes in my functions file and neither worked.

    The one had no affect at all on my home page.

    function df_disable_galleries_on_specific_pages($args) {
    	// 12 is the page ID you'd like lighbox galleries to be disabled
    	if (is_page(461)) {
    		$args['activeGalleries'] = false;
    	}
    	return $args;
    }
    add_filter('rl_lightbox_args', 'df_disable_galleries_on_specific_pages');

    And this just made the images open to full size in the same tab.

    function custom_rl_lightbox_args( $args ) {
    	if ( is_home() || is_front_page() ) {
    		$args['script'] = '';
    	}
    	return $args;
    }
    add_filter( 'rl_lightbox_args', 'custom_rl_lightbox_args' );
    #16247
    Bartosz
    Keymaster

    Can you share a link to your site?

    #16269
    flightoffancy
    Participant
    #16270
    Bartosz
    Keymaster

    Strange – it should work.

    In that case please try that:

    function custom_rl_lightbox_conditional_loading( $display ) {
    	if ( is_home() || is_front_page() ) {
    		return false;
    	}
    }
    add_filter( 'rl_lightbox_conditional_loading', 'custom_rl_lightbox_conditional_loading' );
    #16280
    flightoffancy
    Participant

    That last code just makes it so that the gallery images open full size in the same tab as well.

    #16297
    Bartosz
    Keymaster

    But do they open in a plugin lightbox?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.