How To Display a Message on Old WordPress Posts
If you post helpful information on your blog chances are some of your early posts are now outdated as technologies have changed over the years. Let’s take a look at how we can add a mix of PHP tags to our WordPress themes to automatically add a small disclaimer or warning message to posts over X years old.
The little snippets of code we’re going to add to our theme will allow us to display a message above our post content, but only on posts over a number of years old. We might only want to display this message on certain types of posts, in my case it’s only my tutorials that have become outdated, so we’ll also add a category filter to target only old posts from a particular section of the blog. Read the full story…
