Back to blog

How to Create Image Gallery with ACF in Bricks Builder?

In this blog post, we’ll guide you through the process of creating a dynamic image gallery using Advanced Custom Fields (ACF) in Bricks Builder.

Following the tutorial, you can enhance your blog posts with personalized image galleries and streamline how galleries are added to your content; this guide will show you how to do it efficiently—without adding any code.

How To Create Image Gallery With ACF in Bricks Builder

Consider a scenario: you want to add a unique image gallery to each blog post on your WordPress website. Usually, this process involves using a dedicated image gallery plugin, creating an individual gallery for each post, and embedding it using HTML. As you can imagine, this approach is time-consuming and repetitive.

But with ACF Pro and its powerful Gallery field, you can simplify this process. Once you create a gallery field in the ACF dashboard, configure some settings, the plugin will automatically add a custom field to your post editor. From there, it’s just a matter of uploading your images per post.

To make this even more user-friendly, we’ll use Max Addons for Bricks Builder, which will allow you to pull the dynamic gallery data from ACF into any page or post with ease.

So, let’s get started and see how you can create an image gallery using ACF in Bricks Builder!

Prerequisites

1. Adding a Gallery Field to Your Post Type

Once installed and activated all the plugins, we need to start with creating a gallery field using the ACF plugin. To do that:

In your WordPress dashboard, go to ACF >> Field Groups.

add field groups

On the next page, click + Add New to create a new field group.

add new field

In the Add New Field Group tab, enter a name for your field group. For example, “Blog Post Gallery.”

create image gallery field using acf

From the Field Type dropdown, select “Gallery”

choose gallery field

Set the Field Label to something descriptive, like “Post Gallery”. No need to define the Field Name separately, it will automatically set the name same as the field label.

add field label and name

Keep the Return Format as “Image ID” and the Library settings as default.

choose return format

Scroll down to the Settings section, where you can define the Field’s location. In this case, you’ll want the gallery to appear on blog posts, so set a Location Rule that shows the field group when the Post Type is equal to Post.

define rules

Once you’re done configuring, click Save Changes.

save changes

2. Customizing the Single Post Template in Bricks Builder

Now that your gallery field is set up, the next step is to customize your blog’s Single Post Template to display the gallery dynamically on each blog post.

For that, first in your dashboard, go to Bricks >> Templates.

add new template

You can select an existing pre-built template from the community library or create a new one from scratch.

Once in the template editor, add a Container where you want the gallery to be displayed. Search for the Image Gallery element, and add the element inside the container. Make sure to check the “MAX” tag on the upper-right corner of the element.

customize single post template

3. Linking the ACF Gallery to the Bricks Template

In the Content tab of the Image Gallery element, scroll down to the Dynamic Data section.

Search for “acf” and select your custom gallery field (e.g., post_gallery) from the dropdown. This step connects the ACF gallery to your blog posts.

link acf field

Max Addons provides several interactive layouts for your gallery: Grid, Masonry, Metro and Justified. You can choose any layout that best fits your design.

image gallery layout

Additionally, you also get ability to add effects like TILT effect and plenty of styling option to make your image galleries more catching.

After setting up and customizing the image gallery element, make sure to save the changes.

4. Adding Images to Your Blog Post Gallery

Now that your template is ready, it’s time to add images to the gallery on individual blog posts.

Go to your WordPress dashboard and open any blog post for editing.

Scroll down editor, and you’ll see the Blog Post Gallery field that you created earlier. Click the Add to Gallery button to upload or select media library images.

add images to gallery

After selecting your images, save the post and preview it. You’ll now see your dynamic image gallery displayed on the post page.

save post

This how our dynamic image gallery looks on live post:

dynamic image gallery

Next Read: Create a Filterable Image Gallery using Bricks Builder

By combining ACF Pro with Bricks Builder and Max Addons, you can streamline the process of adding dynamic image galleries to your WordPress posts. Not only does this save you time, but it also allows for greater flexibility and design customization, all while maintaining a seamless workflow.

Another great way that you can present multiple and different category images on your website is by displaying them in a filterable image gallery. If want to create a filterable image gallery without any hustle and bustle, check out our step-by-step guide on how to create a filterable image gallery using Bricks Builder.

You might also be interested in learning how to create a video gallery using Bricks Builder.

Max Addons offers over 20 unique elements to supercharge your website-building process. These elements can streamline your workflow, saving you valuable time and resources. Are you ready to elevate your website creation journey? Get Max Addons today!

If you found this helpful tutorial, please share your thoughts by commenting below!

2 comments

Leave your comment