弹药快板
免费本次带来子比主题美化的文章页底部添加温馨提示,可以表达一些文章过期之后的提示,我在许多子比美化站看到这个,发现他们的教程有点老了,一些步骤可能生效了,所以我就手动更新了一下
[hidecontent type="reply"]首先需要将下面的代码放入子比主题的functions.php里面
//文章过期提示 晓白博客网www.xi6bai.cn
function article_time_update() {
date_default_timezone_set('PRC');
$newdate=time();
$updated_date = get_the_modified_time('Y-m-d H:i:s');
$updatetime=strtotime($updated_date);
$custom_content = '';
if ( $newdate > $updatetime+86400) {
$custom_content= '<div class="article-timeout"><strong><i class="fa fa-bell" aria-hidden="true"></i> 温馨提示:</strong>本文最后更新于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,请在下方<a href="#comment">留言</a></div >';
}
echo $custom_content;
}
上面的代码可以自行修改自己喜欢的字
需要在子比主题后台的自定义css那里添加下面的css加载
/*过期文章提示样式*/
.article-timeout{position:relative; border-radius: 8px; position: relative; margin-bottom: 25px; padding: 10px; background-color: var(--body-bg-color);}
在主题目录zibll/inc/functions/zib-single.php文件中,文章分页函数行,里面的(具体在296行,这是在没有任何代码添加且是子比主题6.1版本的情况下)如果小伙伴有代码修改的话,需要自己寻找地方,具体位置如图
在296行添加这个
article_time_update();//文章过期提示
联系邮箱:ert5tyx@163.com(三个工作日内处理)
Copyright © 2020 · 晓白pos网 皖ICP备2022013394号-7