Lightbox Plus Colorbox
Lightbox appears for galleries even if Gallery checkbox disabled (3 posts)

  1. conualfy
    Posted 2 years ago #

    Even if the checkbox "Use For WordPress Galleries:" is disabled (see here: goo.gl/Kfc4sl), I still get a Lightbox opened for gallery images. This is extremely anoying when one has JetPack Carousel activated for photo galleries, as after closing the carousel, there is a lightbox.

    See how it is disabled: http://goo.gl/Kfc4sl


  2. conualfy
    Posted 2 years ago #

    Not only it opens for galleries, but it also reacts to keyboard interactions with Jetpack. Can you please fix this or assist me for a fix? Thanks a lot!

  3. conualfy
    Posted 2 years ago #

    Just in case others people need a solution, for now, I have found a functional solution by editing 2 plugin files. At least in my installation, now it does not run Lightbox Plus for Jetpack's Tiled Gallery images.

    1. In lightboxplus.php I disabled the else after line 237 as it is useless in our case

    //else {
    //remove_shortcode( 'gallery' );
    //add_shortcode( 'gallery', array( &$this, 'lightboxPlusGallery' ), 6);
    //add_filter( 'the_content', array( &$this, 'filterLightboxPlusReplace' ), 11 );

    2. In classes/actions.class.php I added a new check in the part that checks all image links; we check if the current link has a grandparent having the class tiled-gallery-item. If it has this class, it is an image of Jetpack's tiled-gallery. It is somewhere around line 150.

    foreach($html->find('a[href*=jpg$] img, a[href*=gif$] img, a[href*=png$] img, a[href*=jpeg$] img, a[href*=bmp$] img') as $e) {
                                * Generate HTML5 yes/no

    Add our condition:

    $e1 = $e->parent();
    if (strpos($e1->parent()->class, 'tiled-gallery-item') !== false) {

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Lightbox Plus Colorbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic