• Hi Guido and VSEL-team,

    Within the Divi Theme Builder I make a template and try to get the PHP date format right. It doesn’t display 13/10/2013 but 1697155200. I use the Event Date field within VSEL.
    The date format in the VSEL-settings is j F Y.
    The date/time format in the Divi theme settings is j F Y.
    Time zone is UTC+1 (not: Amsterdam)
    Date variable is %s

    Divi reads the post meta as it is, yet it sees:

    array (  0 => '1697155200',)

    How to solve this?

    Thank you for your help,

    Mitchell

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi,

    Dates / time is stored as UNIX timestamp. To display it in human readable format it requires extra code. I don’t think Divi supports that?

    Guido

    Thread Starter isimedianl

    (@isimedianl)

    Hi Guido,

    Dates / time is stored as UNIX timestamp. To display it in human readable format it requires extra code. I don’t think Divi supports that?

    What extra code? Parallel I will contact Divi what they say about the UNIX timestamp.

    Plugin Author Guido

    (@guido07111975)

    Hi,

    You can use the wp_date() function to display human readable date.

    Guido

    Thread Starter isimedianl

    (@isimedianl)

    Hi Guido,

    I am not familiar with PHP development. Don’t know what you mean and how to implement it. Guess I could use Code Snippets to add a PHP function to the functions.php, but that’s all I know.

    What exact snippet, custom code of filter should I add to make it work?

    Otherwise, is there a shortcode for showing one specific event, in a loop?

    Mitchell

    Plugin Author Guido

    (@guido07111975)

    Otherwise, is there a shortcode for showing one specific event, in a loop?

    When using the shortcode you can display the most recent event, and from a certain category, by adding the posts_per_page and the event_cat attribute to the shortcode. Example:

    [vsel posts_per_page="1" event_cat="your-category-slug" pagination="false"]

    I don’t have experience with Divi so don’t know what’s possible with that plugin.

    Guido

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP format not right within DIvi theme’ is closed to new replies.