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.

Get Blockenberg

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

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Image Gallery”, insert it. Category: Media.
  3. Configure inspector controls that exist on this block. Open Layout. Set “Columns (Desktop)”, “Columns (Tablet)”, “Columns (Mobile)”, “Gap (px)”.
  4. 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

ControlWhat the code does
LayoutSelect 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 RatioSelect 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 EffectSelect 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 CaptionsOn/off toggle in the inspector. Off by default. Saved as `showCaptions`.
Caption StyleSelect control; the chosen value is saved on the block. Options: Overlay (always visible); Hover reveal. block.json default: overlay. Saved as `captionStyle`.
Enable LightboxOn/off toggle in the inspector. On by default. Saved as `lightbox`.
Enable Category FilterOn/off toggle in the inspector. Add a "category" field to image metadata for filtering. Off by default. Saved as `filterEnabled`.
Filter Button RadiusNumeric range control in the inspector. Range 0–30. block.json default: 6. Saved as `filterBorderRadius`.

What the front-end script actually does

When this is the right block

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

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Image Gallery from the Gutenberg inserter.

Get Blockenberg