第一、修改主题的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标志样式902d.com */
.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://static.902d.com/img/new.png);
transform-origin: 0% 0%;
}
最终效果:
© 版权声明
本网站名称:玩转网
本站永久网址:https://www.902d.com
版权声明:知识共享署名-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)协议进行许可
转载时请以超链接形式标明文章原始出处和作者信息,谢谢合作。
本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长977260006@qq.com进行删除处理。
THE END