ACF Gallery Query Loop in Bricks

Updated on 8 May 2024

This Pro tutorial provides the steps to set the images set in a post's Gallery-type ACF field as loop items of a Bricks query loop.

We shall output the post's gallery images as a grid, with each image linking to its full version and the image title and description text appearing below.

While it is possible to use the Image Gallery element and select the Gallery field as its source, using a query loop gives us more control and flexibility.

Step 1

If you haven't already, create a field group having a Gallery type of custom field using ACF.

In our example, we created one with the location rule of Post Type = Page.

This tutorial works with posts of any post type.

Step 2

Edit your posts (Pages in this example) and populate the gallery for each.

Step 3

Add the code from Step 2 of Media File Attachment Data in Bricks tutorial.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to 390+ Bricks code tutorials with BricksLabs Pro