4th Apr '23
/
2 comments

Filtering Cloneable Meta Box Group by Sub Field Value in Bricks

This Pro tutorial provides the steps to filter the rows of a Meta Box cloneable group to only those that have a date custom field value set to today in Bricks query loop.

Use case: Can be used when setting up a restaurant website where the recipes for only the current day should be shown on single posts.

Step 1

Install Meta Box and its AIO extensions.

Create a field group having a Date Picker type of field.

Step 2

Edit your posts and populate the field group.

In this example, today's date is 4 Apr 2023

Step 3

Edit the single Bricks template for your post type.

Copy this Section's JSON and paste it.

We have selected "MB Group: Post Data" as the Query Type where "Post Data" is the ID of the cloneable group.

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

Get access to all 630 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Limiting the Query Loop Posts Output to Post IDs From a Custom Field in Bricks

Limiting the Query Loop Posts Output to Post IDs From a Custom Field in Bricks

A user asks: Recently Bricks introduced the PHP query editor that lets us modify the query parameters right within the query dialog of the builder…
Categories:
Tags:
Pro
Custom Meta Box Thumbnail Slider in WordPress

Custom Meta Box Thumbnail Slider in WordPress

This Pro tutorial provides the steps to set up an image and YouTube video thumbnail slider in WordPress using Splide and Meta Box. The site…
Categories:
Tags:
Filtering Bricks Posts Query Loop by Meta Box Group’s Radio Subfield Value

Filtering Bricks Posts Query Loop by Meta Box Group’s Radio Subfield Value

In the past we showed how a Bricks posts query loop can be filtered by Meta Box group's subfield of types text/number and Datepicker here.…
Categories:
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:
Pro
Meta Box Color Picker to CSS Custom Property Workflow in Bricks

Meta Box Color Picker to CSS Custom Property Workflow in Bricks

This Pro tutorial provides the steps to declare a custom property (CSS variable) whose value is equal to the post-specific color set via a custom…
Categories:
Tags: