ACF/Meta Box Gallery Images as Bricks Slider in Bricks

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

Add the following in child theme's functions.php or a code snippets plugin:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to all 250+ Bricks code tutorials with BricksLabs Pro