Time Since Plugin
At the bottom of each post on this site, a wonderful little WordPress plugin adds how long it’s been since the post was made. It’s called Time Since. But there’s a bug in the example ‘how to use’ code… actually a few, so I’m posting updated examples of how to use the plugin here in the hope that people wondering why this plugin won’t work for them as instructed on their site will pick up on it. Good luck!
Since Entry Publication:
<?php if (function_exists('time_since')) {
echo time_since(abs(strtotime($post->post_date_gmt . " GMT")), time()) . " ago";
} else {
the_time('F jS, Y');
} ?>
Since Comment Publication:
(I don’t use this second example, so I haven’t tested it, but the problem appears to be identical.)
<?php if (function_exists('time_since')) {
echo time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) . " ago";
} else {
the_time('F jS, Y');
} ?>
