I have about 100 posts on my site right now and it keeps growing. Sometimes older posts get out of date because they’re tutorials and software gets updated.
It’s a huge time consumer for me to go back to all my tutorials, read every single one, and update them. So, instead I came up with a way to just target all my posts that are older than three months, and let the user (you) know that if you see something that’s out of date, shoot me an email!
I’m not going to write a huge long post. The process is actually pretty simple. Here’s the snippet:
What this snippet of code is doing is finding today’s date, then finding the date of the post. Once it has those, it finds the difference in days. Than you can target any page you want using conditionals. Add what you want to display, and that’s it!
You can see this snippet in action when you visit an old post of mine! =) Enjoy!