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

Related Tutorials..

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
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:
Meta Box Category Colors in Single Posts

Meta Box Category Colors in Single Posts

Looking to use Meta Box Color Picker fields' values in a single post Bricks template based on the post category? This tutorial shows how. Note:…
Categories:
Tags:
Pro
Posts Grouped by Years and Months in Bricks

Posts Grouped by Years and Months in Bricks

How display posts organized by months & within years based on the published date.
Categories:
HappyFiles Bricks Query Loop

HappyFiles Bricks Query Loop

This tutorial explores different ways in which images from WordPress Media Library organized via HappyFiles can be pulled and shown in Bricks using query loop(s).…
Categories: