Skip to content

Multiple image blocks set to open in light box should connect to create cohesive carousel. #56310

Closed

Description

@jeffgolenski

What problem does this address?

Currently, if I have several full sized images within a post set to open in a lightbox, it's very tedious to view the next image. Each image in a post must be clicked or tapped, then closed in order for viewer to get to the next one. It's not a fluid experience for the viewer.

If I have multiple images in a post set to open in the lightbox, a viewer should be able to tap on one to open the lightbox, and then be able to fuildly navigate to each image within the lightbox, like a carousel.

What is your proposed solution?

  • Desktop: User should be able to use left or right arrow keys to navigate through all the images in the same lightbox
  • Mobile: User should be able to swipe left or right to easily browse all images in the lightbox

Example: In my post I have many images set to open in the lightbox. If I tap on the first image, the lightbox opens, but to view the others I have to close it and tap the other images to re-open the lightbox.

IMG_2492
IMG_2493

cc @mtias @jasmussen

Activity

  1. jasmussen commented on Nov 20, 2023

    @jasmussen
    Contributor

    Good issue, would definitely agree that if we are going to have lightbox enabled in galleries, it should either be a nice gallery there as well, chevrons left and right plus arrow key navigation. Or, just be disabled. I could swear there was already an issue for this, but I didn't find one linked from #51132. CC: @michalczaplinski

  2. michalczaplinski commented on Nov 20, 2023

    @michalczaplinski
    Contributor

    I don't recall there being an issue for this yet, so thank you @jeffgolenski!

  3. michalczaplinski commented on Nov 21, 2023

    @michalczaplinski
    Contributor

    I've linked this issue in Tracking issue: Image Lightbox #51132

  4. bradhogan commented on Dec 20, 2023

    @bradhogan

    +1 on this - very common in all other platforms (webflow, sqs, etc.) would love to see this added soon. Thanks all.

  5. jacobgkau commented on Jan 29, 2024

    @jacobgkau

    Just to clarify behavior, this seems desirable for multiple images within a gallery, but not necessarily desirable for all images in a post. E.g. if I have multiple galleries (which might be separated by paragraphs of text), I'd expect (or like the ability to configure) the lightbox to let someone flip through the images in a single gallery, but stop them when they get to the end of that gallery so they know to continue reading. This is how the baguetteBox.js lightbox plugin I've been using on my site operates.

  6. jacobgkau commented on Feb 1, 2024

    @jacobgkau

    Related: #37652 (this one isn't linked on #51132 yet, maybe that's the one @jasmussen was thinking of earlier? It probably got lost since it was opened long before the 6.4 lightbox was implemented.)

  7. veerap000 commented on Feb 1, 2024

    @veerap000

    +1

  8. aileenf commented on May 15, 2024

    @aileenf

    Another +1 here. A wee bit disappointed that there is no hint of this for 6.6. The single image lightbox works nicely... if gallery support is added, that would be a great thing. Thanks!

  9. jasmussen commented on Jul 3, 2024

    @jasmussen
    Contributor

    I wanted to reference #56587 as having mockups relevant to this issue, notably this one:

    lightbox

    As far as a design for how this could look, at least the experience of it, IMO those designs can work.

    As far as the block editor UI for it, I would recommend keeping things as simple as possible. Right now the way you set lightbox on individual images is in the link dialog:

    Screenshot 2024-07-03 at 15 18 49

    Choose "expand on click". The motivation for this is that it's a click behavior, just like visiting a link is, and opening a lightbox is mutually exclusive to zooming.

    It's honestly the same for galleries and gallery lightboxes, so would a good meaningful first step be to add "Expand on click", and the improved dropdown appearance (which features icons) to this dropdown?

    Screenshot 2024-07-03 at 15 19 05

    It does open a question we have to answer eventually: what happens in a 5 image gallery if all but the third image is set to "expand on click"? My instinct: lightbox arrowkeys would navigate images 1 and 2, then you'd exit, and then you could again swap between 4 and 5, then exit. Of course not ideal, but nevertheless reflecting what you can do.

    CC: @mikachan

  10. luisherranz commented on Jul 3, 2024

    @luisherranz
    Member

    what happens in a 5 image gallery if all but the third image is set to "expand on click"? My instinct: lightbox arrowkeys would navigate images 1 and 2, then you'd exit, and then you could again swap between 4 and 5, then exit. Of course not ideal, but nevertheless reflecting what you can do.

    Can't we remove/hide the "Expand on click" option of the Image block when the image is inside of a Gallery block, and add a global "Expand on click" option to the Gallery block itself?

  11. 14 remaining items

  12. akasunil commented on Aug 1, 2024

    @akasunil
    Member

    A gallery should have the option with same behaviour.

    What do you think?

    I have opened this PR #64014 to implement lightbox setting on gallery.

  13. nekromoff commented on Dec 22, 2025

    @nekromoff

    So is this ready or what? Best practice UX that has been around for 10+ years that WP does not include by default?

  14. bradhogan commented on Dec 22, 2025

    @bradhogan

    @nekromoff I've got a free plugin that does this in the queue for approval that will hopefully get approved soon. The only feature is literally that it adds the option to make a gallery open in a lightbox with arrows to scroll between all gallery photos (in the lightbox).

  15. t-hamano commented on Dec 23, 2025

    @t-hamano
    Contributor

    For those who want to test this feature, it's in development in #62906.

    Please use the link below to give us your feedback:
    https://playground.wordpress.net/?gutenberg-branch=gallery%2Flightbox

  16. tyxla commented on Feb 12, 2026

    @tyxla
    Member

    @t-hamano should we close this one now that #62906 landed?

  17. t-hamano commented on Feb 13, 2026

    @t-hamano
    Contributor

    should we close this one now that #62906 landed?

    I think so. This feature will be available in 7.0. I look forward to your feedback!

  18. leotiger commented on Apr 6, 2026

    @leotiger

    I provide some related enhancement ideas for Gutenberg, e.g. allow to display images added to a carousel block as if working in a gallery on activating overlay. https://github.com/leotiger/wordpress-enhancements

  19. jasmussen commented on Apr 7, 2026

    @jasmussen
    Contributor

    Nice, @leotiger, is this something you would consider contributing to the core project? Notably this piece:

    The Carousel block does not provide a natural slide progression within the same overlay for images included in the carousel block

  20. leotiger commented on Apr 9, 2026

    @leotiger

    Hello @jasmussen, I'm not really into development anymore, I'm working with Wordpress as I need the platform for a specific problem and one of the solutions is WP-based. After many years, decades I'm back using Wordpress. Back than I offered and maintained some plugins for WooCommerce in the WP universe. Right now I will release everything I'm doing to the public, and hopefully someone feels intrigued to push things further... there are some valid ideas, over the next days I will publish more stuff. Once I'm done with my integrations and things are working we can discuss what's good for WP itself and how to give continuity to the rest.

  21. leotiger commented on Apr 11, 2026

    @leotiger

    Finally Multisite was a bad layout decision for my needs, I switched back to single instance, the side effect, I wrote a trid based mu-plugin accompanied by its own language switcher, kind of a WPML for the poor... It's published now within the wordpress-enhancements mentioned above.

  22. leotiger commented on May 17, 2026

    @leotiger

    Hard stuff, being out of the business of doing computer stuff for nearly 10 years was a challenge... Today I submitted a plugin to wordpress.org... Hopefully it is worth attention... Lingua Forge it's called... Personally, I'm quite happy with it, but if it really makes its way depends on many other factors... Have a look at https://github.com/leotiger/lingua-forge
    That said, I need a break, but I'm quite intrigued now with AI... and will have a look if I can contribute as long as it has a return for me... Some minor things I did to solve "personal" problems for my WP single instance may have value for the community... apart from the full-fledged plugin I wrote now based on former work dedicated mostly to be run on my own instance and abstracted into something that may be useful for many people and anger others offering the most basic services behind paywalls. Lingua Forge doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions