X

Show post date & the last modified date

WooCommerce variations list

This is a simple little snippet that will display the last modified date with your post along with the date posted as long as the dates are not the same.



Code Snippet:


Posted on <?php the_time('F jS, Y') ?>
<?php
$u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');

if ($u_modified_time != $u_time) {
echo "and last modified on ";
the_modified_time('F jS, Y');
echo ". ";
}
?>

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!