How to show updated time if post was modified – WordPress

Would you like the updated date of a post only when the post was actually modified?

Compare the modified date with the date of publishing and show the text only if the modified is actually bigger.

Snippet

<?php if ( get_the_modified_time('U') > get_the_time('U')) { ?> <p><small>Updated: <?=get_the_modified_date()?></small></p> <?php } ?>

Resources

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*