When I first built this website, it was always my intention to gradually add to both the content and functionality over time. Rather than trying to launch a website with absolutely everything included—which is, by its nature, impossible—I released it last year as a minimum viable product (MVP).
I’ve been preparing some new content for the site this week, and it reminded me how handy it would be to use WordPress shortcode functionality to include relative dates in the content—for example, instead of manually updating the age of WordPress (22 years) across the entire site at semi-regular intervals.
I have a lot of client work on at the moment, so time has been at a premium. That’s why I’ve dedicated an hour or so this Saturday morning to working on new content and adding this small convenience feature. Although there are certainly more complex ways to achieve this, by far the simplest is to use the WordPress shortcode feature, first introduced in 2008. (As of the date on which you’re reading this, that was 18 years ago—see what I did there?)
If you’d like to take a look at the code and download the small WordPress plugin yourself, check out the GitHub repository. I’d love to hear your feedback—either directly or on social media at Bluesky. Feel free to submit change requests or bug reports via GitHub.
Lead image by Nick Hillier on Unsplash.
