Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$time_defined_as_old = 60*60*24*365; // 1年 | |
if((date('U')-get_the_time('U')) > $time_defined_as_old) { | |
echo '<div class="notice"><strong>ご注意!</strong><br />この記事は1年以上前に投稿された記事で現在は正しい情報とは限りません。</div>'; | |
} | |
?> |
Screen shot
Note
Description | 古い投稿に限定して特定のメッセージを表示出来る。コードは1年前で設定。 |
---|---|
WordPress Ver. | 3.3.1 |
Via | Notify of Old Post in WordPress |