Display Message if Post is older than 1 year


```
function mj_post_older_than_a_year() {
$today = strtotime("today");
//echo "
today: " . $today;
$oneyear = strtotime("-1 year", $today);
//echo "
1year: " . $oneyear;
$postdate = strtotime(get_the_date());
//echo "
pdate: " . $postdate;

if ($postdate <= $oneyear) {
echo ”

This post is more than a year old, so the information may be outdated. Just a heads up.

“;
}
}
“`

Leave a Reply