效果图

zibll/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= '<style>.article-timeout{ color: #8a6d3b;
border-color: #faebcc;margin-bottom:20px;
background-color: #fcf8e3;border-radius:8px;padding:10px 10px;}</style><div class="article-timeout"><strong><i class="fa fa-bell" aria-hidden="true"></i> 温馨提示:</strong>本文最后更新于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,请在下方留言。</div >';
}
echo $custom_content;
}
add_action('zib_posts_content_before','article_time_update');
//文章过期提示结束
© 版权声明
免责声明:本站提供用户下载的所有资源均来自网络,版权归作者本人所有,仅限学习和研究目的的,请支持正版!
我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!邮件:w8l2@foxmail.com
THE END






















暂无评论内容