Most of you probably use the_date() or the_time() in WordPress themes and plugins to display when a specific page, post was published. If you post a high volume of articles each day it may be beneficial to follow a design pattern similar to TechCrunch or Mashable to display the time a post was published in “hours ago”, or “minutes ago”. If you’re using WordPress, this is wicked easy to do with the human_time_diff function.

Posted <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?>

This will give you something like:

Posted 4 hours ago

Meet the Author

Kevin Leary, Boston WordPress Developer of 10 Years

I'm a freelance web developer and WordPress consultant in Boston, MA with 13 years of experience building websites and applications. View a portfolio of my work or request an estimate for your next project.