• Resolved chrisjeub

    (@chrisjeub)


    I would like to manipulate the format of the date as presented in the metadata shortcode. Right now, it defaults to “2019-08-05 06:00:06”. I would like this to display, “August 5, 2019,” or whatever date the article is set to. The shortcode I’m using is “[su_post field=”post_date”]”.

    • This topic was modified 6 years, 10 months ago by chrisjeub.

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

Viewing 1 replies (of 1 total)
  • Plugin Author Vova

    (@gn_themes)

    Hi Chris,

    sorry for the late reply.

    You can use a custom filter to format the date.

    How to:

    1. Add the following code to the end of the functions.php of your active theme:

    function su_post_shortcode_custom_date_filter( $value ) {
    	return date( 'M j, Y', strtotime( $value ) );
    }

    2. Use the following shortcode:

    [su_post field="post_date" filter="su_post_shortcode_custom_date_filter"]
    
Viewing 1 replies (of 1 total)

The topic ‘Changing Date Format’ is closed to new replies.