温馨提示:这篇文章已超过1170天没有更新,请注意相关的内容是否还可用!
第一、修改主题的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标志样式sxlog.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://sxlog.cn/wp-content/themes/zibll/img/new.png);
transform-origin: 0% 0%;
}
最终效果:
文章版权声明:除非注明,否则均为折腾博客原创文章,转载或复制请以超链接形式并注明出处。
还没有评论,来说两句吧...