第一、修改主题的zib-posts-list.php
找到主题目录中的/inc/functions/zib-posts-list.php文件,然后找到对应代码 :
第224行加上:
date_default_timezone_set('PRC');
$t1=$post->post_date;
$t2=date("Y-m-d H:i:s");
$diff=(strtotime($t2)-strtotime($t1))/3600;
if($diff<24){echo '<span class="new-icon"></span>';}
else{echo "";}
//开始输出
第二、添加样式
后台主题设置-全局功能-自定义代码-自定义CSS样式插入
/** 修改NEW标志样式www.dh139.cn */
.tab-content{
positiON: relative;
}
/** NEW 图标文字版样式 **/
.tab-content .new-icon{
position: absolute;
right: 1px;
display: block;
width: 40px;
height: 40px;
line-height: 20px;
background-image: url(https://www.dh139.cn/img/new.png);
transform-origin: 0% 0%;
}
------本页内容已结束,喜欢请分享------
感谢您的来访,获取更多精彩文章请收藏本站。
暂无评论内容