Meta Box Date Field Value Custom Format in Bricks

Updated on 12 Jan 2023

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.

Leave the Save format empty and Placeholder checkbox unchecked.

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

This is a Pro members-only tutorial.

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

  • Dirk Keysser

    Hi Sridhar.
    For some reason this is not working. I tried both with wpcodebox and also in the functions.php
    When I add the fields in Bricks they work fine but I do need to be able to separate out parts of the date and times to display events.
    Any thoughts would be helpful.
    Thanks in advance
    Dirk

    • A

      Hi Dirk. Can you send more details like the URL of a page where the problem can be seen along with your site’s WP login via https://brickslabs.com/support/ ?

      • Dirk Keysser

        Thank you for your help.
        Works great now.
        Dirk

        • John Brown

          Hi Dirk, can you please share how you ended up doing this? Im running into the exact same issue. Thanks!

          • A

            John, do let us know if the problem is still present.

          • Dirk Keysser

            Hi John
            The tutorial is accurate and works as written. I believe Sridhar updated it after my comment. One thing to remember is to use the field id as written in the metabox back end and not the field name as Bricks has it listed. In my case: “event_start” as opposed to “mb_events_event_start”.

            If you are using wpcodebox you need to surround any code involving metabox.io with
            add_action(‘plugins_loaded’, function() {
            //your code here
            }

            Hope this helps

  • Smith Benites

    Thanks for the tutorial, but this only shows me the date in English format and not in the language that is my WordPress, then if I want to put the name of a day, it is complicated because it comes out in another language. Is there a way to display it in the language that WordPress is in?

  • Brian Lovelace

    Thank you SO much for doing these tutorials for both MetaBox & ACF! Just a thought, it might be cooler to have a sort of tab system where it’s one guide, but can switch the content if somebody selects Metabox vs ACF ๐Ÿ™‚ Loving BricksLabs so much so far!

Leave your comment