Title: Link Multiple Galleries
Last modified: June 20, 2021

---

# Link Multiple Galleries

 *  Resolved [planetebleu](https://wordpress.org/support/users/planetebleu/)
 * (@planetebleu)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/link-multiple-galleries-2/)
 * Hello,
 * Thank you so much for a fantastic plugin.
 * I have to create several galleries so the thumbnails are not cropped (e.g., a
   gallery for landscape images, another gallery for portrait images).
 * When in Lightbox mode, and on the last image of the landscape gallery, I would
   like the next arrow to jump to the 1st image of the portrait gallery.
 * Is there a way to achieve that?
 * Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flink-multiple-galleries-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Johannes Kinast](https://wordpress.org/support/users/goaroundagain/)
 * (@goaroundagain)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/link-multiple-galleries-2/#post-14578131)
 * Hi [@planetebleu](https://wordpress.org/support/users/planetebleu/),
 * at the moment, this is not possible out of the box. But the plugin is simple 
   and just uses baguetteBox.js [https://github.com/feimosi/baguetteBox.js](https://github.com/feimosi/baguetteBox.js)
 * You could fork the plugin and change the selector to e.g. `.site-main` here …
 * [https://github.com/goaround/gallery-block-lightbox/blob/176f3bd4c0a0dbbe872a03613fe3a38ab1dc41dc/gallery-block-lightbox.php#L14](https://github.com/goaround/gallery-block-lightbox/blob/176f3bd4c0a0dbbe872a03613fe3a38ab1dc41dc/gallery-block-lightbox.php#L14)
 * … to:
 * `wp_add_inline_script( 'baguettebox', 'window.addEventListener("load", function(){
   baguetteBox.run(".site-main",{captions:function(t){var e=t.parentElement.getElementsByTagName("
   figcaption")[0];return!!e&&e.innerHTML},filter:/.+\.(gif|jpe?g|png|webp|svg|avif
   |heif|heic|tif?f|)($|\?)/i});});' );`
 * Then baguetteBox.js should create one gallery for all images in your post.
    -  This reply was modified 4 years, 10 months ago by [Johannes Kinast](https://wordpress.org/support/users/goaroundagain/).
 *  Thread Starter [planetebleu](https://wordpress.org/support/users/planetebleu/)
 * (@planetebleu)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/link-multiple-galleries-2/#post-14580201)
 * Hi Johannes, this is perfect, thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Link Multiple Galleries’ is closed to new replies.

 * ![](https://ps.w.org/gallery-block-lightbox/assets/icon.svg?rev=2788519)
 * [Lightbox for Gallery & Image Block](https://wordpress.org/plugins/gallery-block-lightbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gallery-block-lightbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-block-lightbox/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-block-lightbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-block-lightbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-block-lightbox/reviews/)

## Tags

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [join](https://wordpress.org/support/topic-tag/join/)
 * [media file](https://wordpress.org/support/topic-tag/media-file/)

 * 2 replies
 * 2 participants
 * Last reply from: [planetebleu](https://wordpress.org/support/users/planetebleu/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/link-multiple-galleries-2/#post-14580201)
 * Status: resolved