Instead of using $post->post_date
, use get_the_time( $format, $post )
.
The correct PHP date format string for your question is 'd/m/y H:i'
.
… Assuming you want a two digit minute (even when less that 10 minutes). Also, I may have the month and day the wrong way around for you.
The format argument in get_the_time()
is PHP’s native date format – http://php.net/manual/en/function.date.php
Then, change your line of code to:
$message = str_replace( '[post_date]', get_the_time( 'd/m/y H:i', $post ), $message );
Though, I think it’ll be easier and neater to just add the get_the_time( 'd/m/y H:i', $post )
to your template, rather than having to put a shortcode into each post.