With PublishPress Blocks plugin, you can show WordPress images inside a lightbox modal. This feature is not available in the normal WordPress gallery block.
This feature is on the Settings screen > “Images” tab in PublishPress Blocks. This will modify the default “Gallery” block in WordPress.
- Open galleries in lightbox: This will automatically add a lightbox display to images in the “Gallery” block.
- Image caption: This feature will automatically take the alt text or caption for an image and show it as captions for images in lightboxes. You can choose between display the caption below the image or over.
Add a “Gallery” block to your content:
Even though a “lightbox” setting isn't visible, you will be able to click on any image in the gallery and see it in a lightbox:
WordPress allows you to add a caption to images, through the Media Library:
This caption text will appear as a caption below the lightbox image:
If you use long captions that can't fit below the image, Image caption overlay will show this result: