Displaying Relative dates is a thing that you often see in Social Media sites like Digg where it says submitted 23 mins ago. A similar concept can be used for Blog posts and comments in WordPress where you can display relative dates as timestamps. This is a good plugin to use in the comments because it helps interaction and shows activity within the blog.
Example of Post/Comment Date and Time
Today
Yesterday
10th January 2007 (2 days ago)
25th January 2007 (2 weeks ago)
21:10 (2 seconds ago)
21:15 (5 minutes ago)
22:15 (2 hours ago)
Installation
Find a similar code in your single.php, index.php, comments.php and page.php
<?php the_date(); ?>
Replace it with:
<?php relative_post_the_date(); ?>
Note: You do not have to update all those files, only update the ones that you like, but those are some that might be needed.
Great post. I'm using it at the moment to configure the relative post dates in my blog.
I do recommend using a better implementation to avoid nasty errors should the plugin be deactivated or break. I have used something like the following:
This means that if Wordpress can't find the function then it just displays the date / time as it would normally.
- spam
- offensive
- disagree
- off topic
Like