6th Sep '23
/
11 comments

ACF/Meta Box Gallery Images as Bricks Slider in Bricks

Updated on 24 Sep 2024

In the past we showed how to create a custom query for showing ACF Pro's Gallery field or Meta Box' Advanced Images fields' images in Bricks slider element here.

It is possible to achieve the same result in a simpler way using the bricks/posts/query_vars filter. This Pro tutorial shows how.

ACF

Step 1

Create a field group attached to your desired post type having a Gallery-type of custom field.

Step 2

Edit your Pages and populate the field.

Step 3

Edit your post type's singular template with Bricks.

Add a Slider (Nestable) element.

Delete Slides 2 and 3.

Select Slide 1 and enable query loop.

Click the loop icon and set Post type to Media.

Step 4

Enable PHP query editor and paste:

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
Ordering Meta Box group rows by a sub field in Bricks

Ordering Meta Box group rows by a sub field in Bricks

In the BricksLabs Facebook group a user asks: Any idea how to set the sort order of a cloneable group in the query? In this…
ACF Relationship: Count of Related Posts

ACF Relationship: Count of Related Posts

Looking to get the number of CPT B posts related to a CPT A post when using a Relationship field with ACF? Here's a custom…
Categories:
Tags:
Pro
Update Post Meta From Another Custom Field’s Value on Post Publish/Update when using Meta Box

Update Post Meta From Another Custom Field’s Value on Post Publish/Update when using Meta Box

In the Meta Box Facebook group a user asks: Hi all, wondering if I can get some help. For custom field 1, I am using…
Categories:
Tags:
Pro
Merging ACF Gallery Images with Featured Image in Bricks

Merging ACF Gallery Images with Featured Image in Bricks

Updated on 12 Mar 2025 In the Bricks Facebook group a user asks: Merging images from different fields into a single gallery Hi, I have…
Categories:
Pro
Conditionally outputting an element in a Query Loop based on date-type custom field

Conditionally outputting an element in a Query Loop based on date-type custom field

This Pro tutorial shows how to output an element in a Bricks' query loop only if the value of a date-type of custom field for…
Categories: