Meta Box Date Field Value Custom Format in Bricks

Updated on 3 Apr 2024

Note: A custom function is no longer needed. Use the date format filter, as mentioned in the Bricks documentation.

Ex.:

{{mb_post_event_date:F, Y}}

to get

"Save value as timestamp" need not be ticked/enabled for the Date Picker field.

Date format reference.


This Pro tutorial is similar to the previous ACF Date Field Value Custom Format in Bricks but when using Meta Box and works with both "Date Picker" and "Datetime Picker" type of fields.

Step 0

Tick "Set value as timestamp" for your field.

If your posts already have the dates set, you'd need to edit them and pick the dates again after making the above change.

Step 1

Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to 390+ Bricks code tutorials with BricksLabs Pro