Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)

Description

This WordPress Plugin adds a simple & lightweight Lightbox to the standard WordPress Image Gallery Block. It detects if a post contains a Gallery Block and then loads & initializea baguetteBox.js, a pure JavaScript Lightbox script without any dependencies and a modern minimal look.

There is no lock in effect. It does not add a new Block Editor/Gutenberg Block and relies solo on the standard WordPress Gallery and Image Block. You can deactivate this plugin at any time and your Gallery and Image Blocks will work as they’ve done before. Just without the lightbox.

Just one important thing to remember: You always have to select Link to → Media File for all of your Galleries & Images to work properly. If you choose None or Attachment Page it will not work. But that’s fine if you don’t want the Lightbox for a specific Image or Gallery.

Here are the features of baguetteBox.js:

  • Written in pure JavaScript
  • No dependencies (e.g. jQuery)
  • Image captions support
  • Responsive
  • Supports swipe gestures
  • Around 13 KB, 7 KB gzipped

Screenshots

  • Simple, modern and minimalistic Lightbox for your Gallery Block
  • Set Link to to Media File on your Gallery Block

Installation

  1. Upload the folder gallery-block-lightbox to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Add a Gallery or Image Block to your Post and set Link toMedia File
  4. Check your Gallery or Image with Lightbox on the front end by clicking on an image

FAQ

When I click on an image, nothing happens

Check if you used the built in Gallery Block and if Link to is set to Media File in the Block sidebar. On an Image Block choose Add Link at the Toolbar.

Does it work for singe images?

Yes! Just set the Link at the Toolbar to Media File

Can I deactivate the Lightbox for a Gallery?

Set Media File to None or remove the Link.

Reviews

November 5, 2020
Just download, install, activate, set gallery image links to media file, and you're all set; how neat is that? Good stuff! Support is excellent! Had 1 questions, and a feature request; guess what? Within 2 hours both had been answered! A nice css solution for my question, and a new version with my request implemented! Keep up the good work, Johannes! 😀
September 21, 2020
A simple light box functionality that works with my gutenberg and oxygen builder smoothly. Thank you.
Read all 7 reviews

Contributors & Developers

“Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)” is open source software. The following people have contributed to this plugin.

Contributors

“Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.3.0

  • Support for the default Image Block

1.2.0

  • Support HTML for the Caption

1.0.0

First release