15th Apr '23
/
2 comments

Meta Box Cloneable Field Query Loop in Bricks

Updated on 5 Mar 2025

This Pro tutorial provides the steps to create a custom query type for outputting the values of one or more instances/items/rows of a cloneable custom field created using Meta Box in Bricks.

This is similar to our earlier Looping Through a Cloneable Meta Box Sub Field in Bricks tutorial.

Note 1: Bricks has built-in support for a Meta Box group. But there could be certain times when you don't want to use a group-type field and hence this tutorial.

Note 2: It is probably easier/simpler/faster to just use a Code Block and output the values of your cloneable field using the code that Meta Box generates than implementing this tutorial.

If you want to use Bricks elements like Basic Text for the output for visual styling though, follow along.

We shall also ensure that the parent Section gets output only if there is at least one item of the cloneable field.

Let's take an example of a Course CPT that has a cloneable "Course Date" Date Picker field.

and for a particular course, the field is populated like this:

Step 1

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

Related Tutorials..

How to create a dynamic infinite logo slider with ACF and Bricks

How to create a dynamic infinite logo slider with ACF and Bricks

This tutorial provides the builder settings, PHP & CSS codes that can be pasted in order to create an infinite logo slider in pure CSS…
Pro
Current Single Post Reference From Inside a Bricks Query Loop

Current Single Post Reference From Inside a Bricks Query Loop

Use case: Get the single post’s custom field (like ACF Repeater or Meta Box Group) array row corresponding to the loop’s counter/index
Categories:
Pro
Categories and SubCategories Query Loop Tabs in Bricks

Categories and SubCategories Query Loop Tabs in Bricks

Learn how to show top-level parent categories as tab titles and the corresponding subcategories as tab contents using Bricks nested queries.
Categories:
Pro
Recently Viewed Posts Bricks Query Loop

Recently Viewed Posts Bricks Query Loop

How to output the most recent X number of posts (any post type) viewed by the current visitor.
Categories:
Pro
Bricks Dynamic Condition – Check if today falls within 5 days before any holiday date

Bricks Dynamic Condition – Check if today falls within 5 days before any holiday date

Creating a custom condition that returns true or false depending on whether today falls within 5 days before any holiday dates selected on a Meta…
Categories:
Tags:
Pro
Meta Box Settings Fields in Bricks

Meta Box Settings Fields in Bricks

This Pro tutorial is the equivalent of our earlier ACF Options Fields in Bricks article but when using Meta Box. While retrieving the values of…
Categories:
Tags:
Pro
Post Data for the Current User in Bricks with Meta Box

Post Data for the Current User in Bricks with Meta Box

How to configure a query loop to output the post data of the SalesRep CPT associated with the current user.
Categories: