やり方2つ。
//その1 <?php //newマークを出す function new_mark(){ $today = get_the_time("Y-m-d"); $today2 = date("Y-m-d", strtotime("-2 day")); $today5 = date("Y-m-d", strtotime("-5 day")); if($today2 < $today){$icon =' <img src="http://xxx/images/new2day.png">';} //2日までこちらを表示 elseif($today5 < $today){$icon =' <img src="http://xxx/images/new5day.png">';} //5日まではこちら else{$icon ="";} echo $icon; } ?> <?php new_mark() ?>//NEWマーク表示 //その2 <?php //newマークを出す function new_mark2(){ $time = time(); if (strtotime('+2 day', get_the_date('U')) > $time) { $icon =' <img src="http://xxx/images/new2day.png" >';} //2日までこちらを表示 elseif (strtotime('+5 day', get_the_date('U')) > $time) { $icon =' <img src="http://xxx/images/new5day.png" >';} //5日まではこちら echo $icon; } ?> <?php new_mark2() ?>//NEWマーク表示