50% discount on BricksLabs Pro Membership Lifetime Access. Use coupon: GOBRICKS

Meta Box Settings Page Custom Field Conditional in Bricks

This is the equivalent of ACF Options Page Custom Field Conditional in Bricks tutorial for Meta Box.

Refer to the previous Meta Box Settings Fields in Bricks tutorial on how to pull and output custom fields from a Meta Box Settings Page incl. those from inside a group-type of field.

This Pro tutorial provides the code for outputting an element (phone number in the header whose value can be set in the Settings page) that has a specific class (header__phone) only when a particular custom field (phone) is populated on the Meta Box Settings page i.e., not empty.

To ensure that the Block/Div/Basic Text element having the phone number is rendered only when the phone field on the Settings page is populated, add the following in child theme's functions.php or a code snippets plugin:

This is a Pro members-only tutorial.

To get full access, login below or sign up for a Pro Account

Leave the first comment