Adds a lightbox option to the WordPress core Image block using Fancybox 4. This plugin lets you enable a lightbox view for individual images or group them into galleries by specifying a gallery slug.
- Adds an "Open in Lightbox" toggle to the core Image block.
- Allows specifying a gallery slug to group images.
- Supports captions.
- Uses Fancybox 4 for a lightweight, modern lightbox experience.
- Loads assets locally (no CDN dependency).
- Fully integrated with the block editor.
- WordPress 6.0+
- Node.js and npm (for development builds)
- Gutenberg block editor enabled
- Download or clone this repository into your
wp-content/plugins/directory. - Run
npm installto install dependencies. - Run
npm run buildto compile assets and copy vendor libraries. - Activate the Image Lightbox Gallery plugin from your WordPress admin.
- Edit or create a post in the WordPress block editor.
- Insert or select an Image block.
- In the block settings sidebar, toggle "Open in Lightbox" to enable the feature.
- Optionally, enter a Gallery Slug to group multiple images into a gallery.
Images with the same gallery slug will be grouped together in a Fancybox lightbox gallery.