Easy Relative Date
Easy Relative Date is a simple plugin to add relative date supports on wordpress powered websites, like ‘Today’, ‘Yesterday’, ‘2 Days Ago’, ‘2 Weeks Ago’, ‘2 ‘Seconds Ago’, ‘2 Minutes Ago’, ‘2 Hours Ago’. The main advantage of the plugin is that it doesn’t override standard wordpress the_date() and the_time() functions, so you can use these functions if you need as well.
Usage
Easy Relative Date can be used for entries as well as for comments. For entries use this code in your template:
if(!function_exists('easy_relative_date')){the_time('F jS, Y'); } else { echo easy_relative_date(get_the_time('U')); }
For comments use:
if(!function_exists('easy_relative_date')){comment_date() . ' at ' . comment_time(); } else { echo easy_relative_date(get_comment_time('U')); }
Pretty easy, and a great way to change up your theme, and possibly make it more relevant since people understand and usually think in relative terms.
baron said:
Aug 17, 09 at 8:23 amWorks great, thank you
Like or Dislike:
3
0
Jerry said:
Aug 17, 09 at 3:16 pmIt seems this code is not compatible with the threaded comment system, which hides the call to the time function in (if memory serves, which is far from likely) Walker.php, taking it out of template control. It’s really a problem with the comment implementation forsaking templates, but still a pain in the patoot. Any suggestions?
(Also, you’re collecting spam in your comment thread.)
Like or Dislike:
2
0
Nico said:
Oct 07, 09 at 10:19 amI really like your plugin but when it is active I can’t write new posts. WP says the following:
Warning: Cannot modify header information - headers already sent by (output started at […]/wp-content/plugins/easy-relative-date/easy_relative_date.php:1) in […]/wp-includes/classes.php on line 1586
what can I do? please help!
Like or Dislike:
1
0
jez said:
Oct 24, 09 at 12:07 pmI am getting:
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression
so as soon as I activate the plugin the entire site dies.
any ideas?
Like or Dislike:
0
0
mugger said:
Nov 23, 09 at 12:12 pmDirections seem to not be complete for making
‘Today’, ‘Yesterday’, ‘2 Days Ago’, ‘2 Weeks Ago’, ‘2 ‘Seconds Ago’, ‘2 Minutes Ago’, ‘2 Hours Ago’.
Like or Dislike:
0
0