Media · Gutenberg
Image Gallery block for WordPress
Responsive image gallery with grid/masonry layouts, lightbox, and hover effects.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Responsive image gallery with grid/masonry layouts, lightbox, and hover effects.
Inspector panels on this block: Layout, Hover & Captions, Lightbox, Filter Bar. Those titles come from index.js, not from a shared template.
Behavior controls: “Layout” options: Grid (equal), Masonry, Justified (rows); “Aspect Ratio” options: Square (1:1), Landscape (4:3), Wide (16:9), Portrait (3:4), Tall (2:3); “Hover Effect” options: Zoom, Fade Overlay, Slide Up Caption, Grayscale, None; “Caption Style” options: Overlay (always visible), Hover reveal.
Where to find it
Gutenberg inserter → Media → search “Image Gallery” (block name `blockenberg/image-gallery` in block.json). Style it in the sidebar after insert.
How to use Image Gallery block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Image Gallery”, insert it. Category: Media.
- Configure inspector controls that exist on this block. Open Layout. Set “Columns (Desktop)”, “Columns (Tablet)”, “Columns (Mobile)”, “Gap (px)”.
- Check the published page. The view script reads HTML data attributes: data-category, data-filter, data-lightbox. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Layout | Select control; the chosen value is saved on the block. Options: Grid (equal); Masonry; Justified (rows). block.json default: grid. Saved as `layout`. |
| Columns (Desktop) | Numeric range control in the inspector. Range 1–8. block.json default: 3. Saved as `columns`. |
| Columns (Tablet) | Numeric range control in the inspector. Range 1–5. block.json default: 2. Saved as `columnsTablet`. |
| Columns (Mobile) | Numeric range control in the inspector. Range 1–3. block.json default: 1. Saved as `columnsMobile`. |
| Gap (px) | Numeric range control in the inspector. Range 0–60. block.json default: 12. Saved as `gap`. |
| Aspect Ratio | Select control; the chosen value is saved on the block. Options: Square (1:1); Landscape (4:3); Wide (16:9); Portrait (3:4); Tall (2:3); Auto (original). block.json default: square. Saved as `aspectRatio`. |
| Border Radius (px) | Numeric range control in the inspector. Range 0–30. block.json default: 8. Saved as `borderRadius`. |
| Hover Effect | Select control; the chosen value is saved on the block. Options: Zoom; Fade Overlay; Slide Up Caption; Grayscale; None. block.json default: zoom. Saved as `hoverEffect`. |
| Show Captions | On/off toggle in the inspector. Off by default. Saved as `showCaptions`. |
| Caption Style | Select control; the chosen value is saved on the block. Options: Overlay (always visible); Hover reveal. block.json default: overlay. Saved as `captionStyle`. |
| Enable Lightbox | On/off toggle in the inspector. On by default. Saved as `lightbox`. |
| Enable Category Filter | On/off toggle in the inspector. Add a "category" field to image metadata for filtering. Off by default. Saved as `filterEnabled`. |
| Filter Button Radius | Numeric range control in the inspector. Range 0–30. block.json default: 6. Saved as `filterBorderRadius`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-category, data-filter, data-lightbox.
- Keyboard handlers move focus between items.
When this is the right block
- Responsive image gallery with grid/masonry layouts, lightbox, and hover effects — that is the job of Image Gallery, not a generic content block.
- Use it when you need the editor control labeled “Columns (Desktop)”, which exists on this block’s inspector.
- It matches pages about gallery, images, photos.
- Inserter grouping: video, animation, and rich media sections.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Image Gallery block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Image Gallery”. It sits under Media. After insert, open Layout and set “Columns (Desktop)”, “Columns (Tablet)”, “Columns (Mobile)”, “Gap (px)”.
What makes Image Gallery different from other Blockenberg blocks?
Responsive image gallery with grid/masonry layouts, lightbox, and hover effects. Inspector labels on this block include “Columns (Desktop)”, “Columns (Tablet)”, “Columns (Mobile)”, “Gap (px)”.
Is the Image Gallery Gutenberg block free?
Yes. Image Gallery ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Image Gallery to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Layout, Hover & Captions, Lightbox, Filter Bar).
Related media blocks
Lightbox Gallery
Image grid where clicking a thumbnail opens a full-screen lightbox with prev/next navigation.
Image Cards
A responsive grid of rich cards with images, category tag, title, description and CTA. Perfect for blog previews, portfolio, services or team showcases.
Thumbnail Gallery
Large main image with a scrollable thumbnail strip navigation.
Video Grid
Responsive grid of video cards with play-in-lightbox functionality. Supports YouTube, Vimeo, and self-hosted videos. Custom thumbnails, titles, and duration badges.
Filter Gallery
Image grid with category filter buttons. Clicking a tag shows/hides matching items with animation.
Image Collage
Creative overlapping image composition with up to 5 images, custom rotations, positions, frames and a floating overlay card. Perfect for hero and about sections.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Image Gallery from the Gutenberg inserter.