You're here: Home » WordPress » Show Last Post Revision Date

Show Last Post Revision Date

On Aug 27, 2011 under WordPress

Some blog posts may require to be revised often with the latest updates and in that type of posts readers would like to know the last revision date to understand whether the post has been updated or not. You can easily display the last modified date of a post using the php code presented below.

Paste the below code in your theme files within the post loop. I generally use it in post template (single.php) file.

<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time != $u_time) {
echo "Last Revised on ";
the_modified_time('F jS, Y');
} ?>

Here the format is: April 12, 1989. For other time and date formats visit Function Reference/the modified time.

Comments on this entry (3 comments)

Did you like this post? You can share your opinion with us! Simply click here.

  1. Gaurav says:

    nice post… really awesome post…

Leave a Reply

CommentLuv badge