Top

Daily Tip: How to Use Fuzzy Dates For WordPress Posts

March 31, 2010

Many social networking sites display dates and times as relative to the current day- ie. ‘Today’, ‘Yesterday’, ‘2 Days Ago’, ‘2 Weeks Ago’, ‘2 ‘Seconds Ago’, ‘2 Minutes Ago’, ‘2 Hours Ago’.

You can do this too with your WordPress updates. Grab the WP-Relative Date plugin and install it. Then, open your index.php, single.php, page.php or any other file using the_date and edit as follows:

Replace this:

<?php the_date(); ?>

With this:

<?php relative_post_the_date(); ?>

Now you should have “fuzzy” dates for your updates. :)

Tweet This Post

Because this plugin/widget is provided free of charge, I simply ask you to link back to Pressography.com in a post on your blog, or from one of your sites. It doesn't need to be anything fancy - just a note saying that you're using it, and whether or not you like it. However, there is no requirement that you do this, you're free to use the plugin regardless.

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.