Skip to content

Instantly share code, notes, and snippets.

@rodica-andronache
Created October 22, 2013 08:59
Show Gist options
  • Select an option

  • Save rodica-andronache/7097416 to your computer and use it in GitHub Desktop.

Select an option

Save rodica-andronache/7097416 to your computer and use it in GitHub Desktop.
display x time ago for posts and comments
For posts: <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?>
For comments:<?php echo human_time_diff(get_comment_time('U'), current_time('timestamp')) . ' ago'; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment