Return to Snippet

Revision: 40411
at February 1, 2011 14:44 by firewalker06


Initial Code
<?php
// Put inside Post Loop

$time_defined_as_old = 60*60*24*365; // A Year

if((date('U')-get_the_time('U')) > $time_defined_as_old) {
  echo '<div class="notice"><strong>Notice</strong><br />This article is published more than one year ago. Information in this article might be irrelevant with current situation</div>';
}

?>

Initial URL


Initial Description
## Benefit
To notify visitors that the current post they are viewing is an old post. Suitable for Blog / Website that provide timely articles

Initial Title
Notify of Old Post in WordPress

Initial Tags
php, wordpress

Initial Language
PHP