wp-days-ago v1.7.1
Update: The plugin has been updated to version 2.0.1. All users are encourage to upgrade.
My WordPress plugin, wp-days-ago, has been updated to version 1.7.1.
This plugin displays the number of years and days since a post or a page was published. All calculations are based on days but it will not take into account that 24 hours are one day. If you publish a page or a post at 23:59, it will be marked with “yesterday” at 00:00 even if it’s only a minute since you published. In some cases, the plugin will display a human readable text instead of the days count. Today is “today” and not “0 days ago”. Yesterday is, well, “yesterday”, while anything published seven days ago is posted “a week ago”. If an entry is more than a year old, the plugin will display the post date as “X years, Y days”.
Installation
- Download the plugin.
- Unzip the contents of the downloaded file to the /wp-content/plugins/ directory of your WordPress installation.
- Log in to your WordPress dashboard and activate the wp_days_ago plugin that should now be visible in the list.
- You can now insert anywhere in The Loop in your WordPress theme.
No changes to your theme or configuration are necessary when you upgrade from a previous version.
Changelog
- Backwards compatible all the way back to WordPress 1.5.
- The plugin now uses the internal WordPress timezone settings.
- Added optional parameters that allows configuration of appended text, prepended text and the texts displayed by the plugin.
For detailed information on usage and available parameters, please see the plugin’s page at WordPress.org or the readme-file in the ZIP-file.
Feedback
Do you have any thoughts you want to share? A question, maybe? Or is something in this post just plainly wrong? Then please send an e-mail to vegard at vegard dot net
with your input. You can also use any of the other points of contact listed on the About page.
Thanks for the plugin!
I’ve forked your code an made it less precise for a site I’m building.
If you have this on GitHub already, let me know and I’ll fork from there instead, but I couldn’t find it.
https://github.com/gazoombo/wp-days-ago
The plugin is not available on GitHub, only in the Wordpress plugin SVN repository. But I’ll surely watch it in case you make any changes I’d like to merge back into the original plugin. I’d love to see the site you’re working on when it goes live, to see the plugin in action on another site than mine, so a link would be great. Thanks a lot in advance.
This is great, but how do I get it to work on custom post types?
I’m afraid I can’t help you with that, I’ve never worked with custom post types. Actually, I didn’t know they existed until I read your comment…