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 628 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Current Post’s Terms in Bricks

Current Post’s Terms in Bricks

Updated on 15 Jan 2024 This Pro tutorial provides the steps to set up a grid of terms (like categories) that the current post is…
Pro
Conditional Output Based on ACF Date Field in Bricks

Conditional Output Based on ACF Date Field in Bricks

Updated on 1 Aug 2024 Looking to have a Section or other elements in Bricks rendered on the frontend only if today's date is before…
Categories:
How to import custom posts with featured images and custom fields by fetching an API using a single AJAX call

How to import custom posts with featured images and custom fields by fetching an API using a single AJAX call

In this tutorial, we will import a list of movies - including images and custom fields - inside a custom post type by fetching a…
Categories:
Tags:
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
Featured Image’s Meta in a Bricks Posts Query Loop

Featured Image’s Meta in a Bricks Posts Query Loop

How to output values of custom fields for the featured image of current post in a query loop
Categories:
Tags: