15th Dec '23
/
2 comments

Random Row from ACF Repeater in Bricks

In the past, we shared how the first row of a ACF Repeater can be output in a Bricks query loop here.

This Pro tutorial shows how the query results can be filtered to return a random row.

Step 1

Enable query loop on an element and select your ACF Repeater as its query type.

Step 2

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

Get access to all 621 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Sorting ACF Relationship Posts by Date Meta in Bricks

Sorting ACF Relationship Posts by Date Meta in Bricks

Consider the following setup: CPT: Events ACF Fields:Event Date Information (Group)|__Event Date (Date Picker)Pick Sub Events (Relationship) An Event can have 1 or more related…
How to hide/remove the Block Element from the Bricks Builder

How to hide/remove the Block Element from the Bricks Builder

Don't like the new Block element in Bricks? Just copy/paste the following code into your child theme's functions.php. By the way, It's a terrible idea…
Categories:
Tags: