Support » Plugin: WP jQuery Lightbox » WP jQuery Lightbox] grouping slideshows

  • Resolved placeboarts


    Is there a way to “group” different galleries together so that when lightbox opens up, it doesn’t keep going onto the next group of images or gallery?

    Would be great if a unique name could be added to each shortcode to keep the different galleries separate. An alteration of the “rel” tag does not work because the shortcode is being used to insert a group of images.

    Check out this page to see what I’m getting at.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author ulfben


    The assumption is that all pictures attached to a post is one set, and that multiple galleries are used primarily to format the layout.

    WP jQuery Lightbox is not aware of the shortcodes – it simply filters the post content. It might be possible to add a set identifier to the gallery shortcode, but I’m not sure.

    I’ll try and look into this at some point.

    (Link for future reference )

    Plugin Author ulfben


    The current implementation is really short and sweet; a single line regexp finds all links-to-images that doesn’t already have a rel-attribute, adds the rel=”lighbox[]” (grouping them by post ID).

    To separate a post’s galleries from eachother we’d need to add the rel attribute long before this step – somewhere where WordPress is still dealing with the gallery-shortcode (and thus aware of their attributes).

    A first line of attack might be;

    1. filter post_gallery to read our new shortcode attribute (“instance” or “set”)
    2. put the current set ID in a global variable to make it available to…
    3. … a wp_get_attachment_image_attributes-filter, where we now can add rel=”lightbox[#set]” to the output.
    4. ???
    5. PROFIT!

    Seems like it should work without much overhead. We’ll just bail if post_gallery does not provide the set-attribute.

    One could also forego the shortcode attribute and make this behaviour a global setting – “always group by instance” or “always group by post”.

    Convenient, but less flexible.

    Thanks for the detailed response and helpful link ulfben!
    I’m not too familiar with creating wordpress filters or creating custom global settings. I’ll have to read up on these more…

    Plugin Author ulfben


    Nah, I’ll take care of it. It seems like reasonable functionality to support. No timeline though.

    Thanks @ulfben. This looks like an excellent addition. I’m coming from Lightbox Plus, which uses this functionality, because I was having trouble with the title and captions not being listed correctly in the lightbox. I wanted a simplified plugin, so I’m giving yours a try. This gallery-separation functionality would be awesome!

    Hi ulfben,
    Did you get any further with the gallery separation function? I have managed to place three galleries on a page – each taken from individual posts setup to hold each gallery. There are say 7 images in each gallery. However I am still getting all 21 images displaying in the Gallery Lightbox. Any ideas?

    Any help much appreciated…


    Plugin Author ulfben


    gallery grouping is in the latest version. Here’s an example of how to use it:

    [gallery link="file" ids="1,2,3" group="monday"]
    [gallery link="file" ids="5,6,7" group="tuesday"]
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP jQuery Lightbox] grouping slideshows’ is closed to new replies.