14th Dec '23
/
14 comments

ACF Gallery Query Loop in Bricks

ACF Gallery Query Loop in Bricks

Updated on 1 July 2024

This Pro tutorial provides the steps to set the images set in a post's Gallery-type ACF Pro 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.

Ensure that the return format is set to Image ID.

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

Implement Steps 2 and 3 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

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Limit the Number of Posts in a Bricks Query Loop of Relationship Type

Limit the Number of Posts in a Bricks Query Loop of Relationship Type

Updated on 12 Dec 2023 Bricks Query Loop popup does not have a control for setting the number of posts to be output when the…
Pro
Upcoming Events Grouped by ‘Month Year’ in Bricks

Upcoming Events Grouped by ‘Month Year’ in Bricks

A custom query loop type for showing future events based on a date custom field using three nested query loops.
Pro
Custom Nested Queries in Bricks

Custom Nested Queries in Bricks

In most of the previous tutorials covering nested query loops in Bricks on this site, we accessed the parent query's looping object in the inner…
Categories:
Pro
Related Posts using ACF Post Object in Bricks

Related Posts using ACF Post Object in Bricks

Modifying the query loop to limit the posts to only related posts via an ACF Post Object custom field.
Categories:
Tags:
Dynamic Post Galleries in Lightboxes using BricksExtras

Dynamic Post Galleries in Lightboxes using BricksExtras

How to show post-specific galleries as sliders using BricksExtras when a “Open Gallery” link is clicked in post cards in a posts grid.
Categories:
Querying Posts by Date Field to Exclude Past Events with ACPT Plugin

Querying Posts by Date Field to Exclude Past Events with ACPT Plugin

In the Bricks' Facebook group, a user asked: Meta query? What am I missing?Hi all, really need a little guidance on this one. I have…
Categories: