看到很多人无私分享自己的心得,我也来发一篇,感谢大家的分享,希望能从更多的分享中学到更多新知识。
论坛(社区)文过期提示
原理和文章失效提示一样,关键在于找准位置,前两步和文章过期失效提示一样。
1.将下面的函数代码加入wp-content/themes/zibll/functions.php中或者自建的func.php文件中
//文章过期提示
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>或联系<a target="_blank" title="EK汉化" href="https://ekhanhua.com/messages"><b>EK社长</b></a>。</div >';
}
echo $custom_content;
}
2.CSS代码:(在自定义CSS样式添加下面代码)
/*过期文章提示样式*/
.article-timeout{position:relative; border-radius: 8px; position: relative; margin-bottom: 25px; padding: 10px; background-color: var(--body-bg-color);}
3.在主题目录inc/functions/bbs/inc/single.php文件中,文章分页函数下面添加代码。
article_time_update();//文章过期提示
隐藏评分头像
当初发过求助帖,没有实质性的解决,只能暴力删除某行代码达到效果。相信很多人都苦于点赞人数过多,手机阅读感特别差,希望对大家有帮助。
方法:可以搜“评分明细”,删除下图中的这一行即可
效果演示