29th Jun '22
/
2 comments

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 fields at the top level in Meta Box settings page is straightforward, we will need to write a custom function to get the values of fields inside a group.

Step 1

Install Meta Box and Meta Box AIO plugins.

Go to Meta Box > Settings Pages and click New Settings Page.

Give it a title of say, "Sitewide".

Click Publish.

The Settings Page ID should already become sitewide. We will be referring to this slug in a later step.

Step 2

Go to Meta Box → Custom Fields and create fields or import this field group.

Step 3

Click Sitewide in the admin menu and populate the custom fields.

Step 4

To get the value of the phone field in Bricks editor, here's the dynamic tag:

{mb_sitewide_phone}

where sitewide is the Option name (if present) or the Settings Page ID and phone is the ID of the field in that settings page.

To have the phone number as a link, set the URL (External URL) to:

tel:{mb_sitewide_phone}

Let's define a custom function to get the value of a specified custom field from inside the specified group on Meta Box Settings page.

Add this in child theme's functions.php:

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
Meta Box Image Advanced Field Images in Bricks Query Loop

Meta Box Image Advanced Field Images in Bricks Query Loop

Updated on 3 Feb 2025 A user asked: Do you know what the best way to query an image from metabox gallery? I would like…
Categories:
Tags:
Pro
Meta Box Checkbox List Query Type in Bricks

Meta Box Checkbox List Query Type in Bricks

This Pro tutorial provides the steps to add a new query type in Bricks builder for displaying the values of a Checkbox List type of…
Categories:
Pro
Filtering posts by a group field’s true / false field sub field value with ACF or Meta Box in Bricks

Filtering posts by a group field’s true / false field sub field value with ACF or Meta Box in Bricks

This Pro tutorial covers how posts of a Bricks query loop can be filtered to show only the ones whose true / false or checkbox…
Categories:
Tags:
Pro
MB Favorite Posts in Bricks

MB Favorite Posts in Bricks

This tutorial explores using MB Favorite Posts in Bricks, including outputting the list of favorites via a query loop.
Categories:
Pro
Ordering Meta Box group rows by a sub field in Bricks

Ordering Meta Box group rows by a sub field in Bricks

In the BricksLabs Facebook group a user asks: Any idea how to set the sort order of a cloneable group in the query? In this…
Pro
Meta Box Related Project’s Featured Image URL on Single Reviews

Meta Box Related Project’s Featured Image URL on Single Reviews

Updated on 26 Jun 2025 In a recent website I worked on, a requirement was to get the URL of the featured image of a…
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: