Relative dates are where, instead of showing the exact date of a post, you can say it was posted "4 days ago". Tomorrow, this message would say "5 days ago". This plugin has been designed to be called from your theme (manually or automatically) to display these relative dates, as required.
All relative dates are shown up to 2 depths and are not designed to be 100% accurate (due to rounding), but rather to give the reader an idea as to how old something is.
Some examples...
Something that is 1 year and 2 months and 3 weeks old will be output as "1 year, 2 months".
Something that is 2 year and 0 months and 3 weeks old will be output as "2 years, 3 weeks".
Key features include...
- Change your theme yourself or automatically convert the dates
- Set output depth and your own dividers
- Specify two dates if you wish so you can add your own time range
- And much, much more!
Technical specification...
- Licensed under GPLv2 (or later)
- Designed for both single and multi-site installations
- PHP7 compatible
- Fully internationalized, ready for translations. If you would like to add a translation to this plugin then please head to the Translating WordPress page
- WCAG 2.0 Compliant at AA level
Please visit the
Github page for the latest code development, planned enhancements and known issues.
Relative Date can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New). Alternatively, it can be downloaded from
WordPress.org and installed manually...
- Upload the entire
wp-relative-date
folder to your wp-content/plugins/
directory.
- Activate the plugin through the 'Plugins' menu in WordPress administration.
Voila! It's ready to go.