规定时间内发布的文章显示new标签

<?php
$pub_date = strtotime(get_the_date("Y-m-d H:i:s")) + 30*24*60*60;
$cur_date = strtotime(date("Y-m-d H:i:s")); ?>
<span class="time <?php if($pub_date >= $cur_date ){ echo 'shownew';}?>"><?php the_time('Y.m.d'); ?></span>