Paste the following code in your single.php file, within the loop. Edited the text on line 7 as desired.
<? $ageunix = get_the_time('U'); $days_old_in_seconds = ((time() - $ageunix)); $days_old = (($days_old_in_seconds/86400)); if ($days_old > 365) { echo '<div class="disclaimer">DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.</div>'; } ?>
The post WordPress tip: How to display a disclaimer on posts older than one year appeared first on WPRecipes.
What’s My SEO Score?
Enter the URL of any landing page or blog article and see how optimized it is for one keyword or phrase.
Latest posts by WordPress Expert (see all)
- How to Embed Instagram Feed in WordPress (5 Easy Steps) - September 26, 2023
- MemberPress vs WishList Member: Which is The Best Membership Plugin? - September 18, 2023
- 7 Best Divi Builder Alternatives for Your Website (Compared) - September 14, 2023