在index.php里找到包含<?php the_title(); ?>的地方, 在<?php the_title(); ?>后面加上如下代码:
?Download download.txt
1 2 3 4 5 6 | < ?php
$t1=$post->post_date;
$t2=date("Y-m-d H:i:s");
$diff=(strtotime($t2)-strtotime($t1))/3600;
if($diff< 24){echo "< img src='http://www.graygift.com/new.gif' alt='NEW'> ";}
?> |
将’http://www.graygift.com/new.gif,换成你要用的new图标,最好是使用绝对地址,不然会出些麻烦 – - 嘿嘿,不说你也应该知道。 你想在哪出现这个new标记,就放在哪吧。赶快试试吧!^_^ 这样新的文章就会出现NEW。 转载自:http://oi22.com/teach/to-add-a-new-tag-article.html

对《给新文章加个“new”》评论