Home Forums Front-end Issues How to change the frontend output (datefied)


How to change the frontend output (datefied)

  • Hi comunity,
    I created a date field that it is called “datumsfeld”. In my theme I wrote:

    <?php the_field(‘datumsfeld’); ?>

    The output in the frontend is something like:
    31 9 Y
    But I would like to have:
    31. september 2020

    or maybe:
    31. 09. 2020

    How and where can I change the output of the frontend? I suppose there is either some interface for doing that or I can do it in my theme using php.

    I would be glad if somebody could herlp me.

  • Date fields have 2 settings “Display Format” and “Return Format”. The first is used when editing a post and the second is used when using get_field(), the_field(), etc.

    If these do not work for you for some reason then you would need to format the value yourself using PHP date() functions.

  • You can change this in to the field and for the date formatting you need to see this

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.