ACF Gallery module
On this page
The ACF Gallery module shows the images of an ACF Gallery field as a grid, masonry or justified gallery, with a hover effect, captions and a lightbox. Add images to each post once, and the same module shows the right gallery on every post. For more details, view the demo.

Note: This module works with Divi 5 only. If you don’t see it in the module list, go to Divi Extended → Divi Plus → General → Modules, turn on ACF Gallery and save.
Before you start: create the gallery field#
The module needs an ACF Gallery field. The Gallery field type is part of ACF PRO and of the free Secure Custom Fields plugin; the free ACF plugin does not have it.
- Go to ACF → Field Groups (or SCF → Field Groups) and click Add New.
- Add a field with the Field Type set to Gallery, and note its Field Name, for example
post_gallery. - Under Settings → Location Rules, choose where the field shows, for example Post Type is equal to Post, and save.
- Edit a post, add images to the new gallery field and update the post.

Then add the ACF Gallery module to the post, or to a Theme Builder template for posts, and enter the same field name in ACF gallery field name.
How to add the module#
- Open your page in the Divi Visual Builder.
- Click the (+) icon inside a row to add a new module.
- Search for DP ACF Gallery in the module search box.
- Click the module to insert it. Its settings open on the right.

Content tab#
The Content tab sets which field and post the images come from, the layout, what happens on click and the hover effects.

Content tab: Source#
- ACF gallery field name: Here you can input the name of the ACF Gallery field that holds the images.
- Read the field from: Here you can choose whether the field is read from the current post or from a post you choose by ID. Options: Current post and Post ID.
- When there are no images: Here you can choose what is shown when the field has no images, or the ACF plugin is not active. Options: Hide the module and Show placeholder text.

Content tab: Display#
- Layout: Here you can choose how the images are arranged. Every image is shown in every layout. Options: Grid, Masonry and Justified.
- Columns: Here you can choose the number of columns.
- Gap between images: Move the slider or input the value to increase or decrease the space between the images.
- Image aspect ratio: Here you can choose the shape every image is cropped to. Auto keeps the original shape.
- Equal height per row: Here you can choose whether or not the images in each row are set to the same height, the height of the tallest image in that row. Rows can differ from each other. It applies when the aspect ratio is Auto.
- Show title: Here you can choose whether or not the image title from the media library is displayed in the hover overlay.
- Show caption: Here you can choose whether or not the image caption from the media library is displayed in the hover overlay.
- Show overlay icon: Here you can choose whether or not an icon is displayed in the hover overlay.
- Overlay icon: Here you can select the icon displayed in the center of the hover overlay.



Content tab: Click action#
- When an image is clicked: Here you can choose what happens when an image is clicked. Custom Link opens the link set in the Custom Link field of each image in the media library. Images without a link are not clickable. Options: Open in lightbox, Custom link and Do nothing.
- Lightbox caption: Here you can choose where the text shown under the image in the lightbox comes from. Options: Caption, Title and None.

For Custom link, open each image in Media → Library and fill in the Custom Link field that Divi Plus adds to the image details.

Content tab: Hover#
- Image hover effect: Here you can choose the effect of the image when the mouse is over it. Options: None, Zoom and Grayscale to color.
- Line hover effect: Here you can choose a line effect drawn over the image when the mouse is over it. It works together with the image effect and the overlay. Options: None, Frame, Corners and Draw lines.

The Link, Background and Meta groups are the standard Divi options.
Design tab#
The Design tab styles the images, the hover overlay and its icon, the captions and the lightbox.

Design tab: Image#
- Hover zoom: Move the slider or input the value to set how much the image grows on hover. 1 means no change.

Design tab: Overlay#
- Overlay background: Adjust the background style of this element by customizing the background color, gradient, image, video, pattern and mask.
- Overlay background color
- Content alignment: Here you can choose how the icon, caption and description are aligned inside the overlay. Options: Left, Center and Right.
- Gap between overlay elements: Move the slider or input the value to increase or decrease the space between the icon, caption and description.

Design tab: Overlay icon#
- Icon color: Here you can define the color of the icon.
- Icon size: Move the slider or input the value to increase or decrease the size of the icon.

Design tab: Caption#
Use the standard Divi text settings (font, weight, size, color, line height, letter spacing, alignment and more) to style the caption.

Design tab: Lightbox#
- Background color: Here you can define the color of the background behind the lightbox image.
- Close button color: Here you can define the color of the close button.
- Arrow color: Here you can define the color of the previous and next arrows.

The Sizing, Spacing, Box shadow, Filters, Transform and Animation groups are the standard Divi design options.
Advanced tab#
The Advanced tab has the standard Divi options: CSS ID and classes, custom CSS, attributes, conditions, visibility, transitions, position and scroll effects.
