fankeji

Picture shown

Picture [1] - Sub-ratio theme beautification - Add last update time or expiration invalidation prompt at the bottom of the article - Ink dye cloud sky - Communication and sharing of network technology - resource station, technology station, information network

hc199800

There are three steps

1. Add the following PHP code to the themes/zibll/functions.php file.

//文章过期提示开始
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="xx站" href="http://wpa.qq.com/msgrd?v=3&uin=1628050&site=qq&menu=yes"><b>站长</b></a>。</div >';
}
echo $custom_content;
}
//文章过期提示结束
//文章过期提示开始
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="xx站" href="http://wpa.qq.com/msgrd?v=3&uin=1628050&site=qq&menu=yes"><b>站长</b></a>。</div >';
    }
        echo $custom_content;
    }
//文章过期提示结束
//文章过期提示开始 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="xx站" href="http://wpa.qq.com/msgrd?v=3&uin=1628050&site=qq&menu=yes"><b>站长</b></a>。</div >'; } echo $custom_content; } //文章过期提示结束

2. In the themes/zibll/inc/functions/zib-single.php file of the theme directory, add the following code below the article pagination function (mine is at line 322, because my code has changed, all indeterminate lines, see the figure below).

Picture [2] - Sub-ratio theme beautification - Add last updated time or expiration invalidation prompt at the bottom of the article - Ink dyeing cloud sky - Communication and sharing of network technology - resource station, technology station, information network

Article pagination code placement

article_time_update();//文章过期提示
article_time_update();//文章过期提示
article_time_update();//文章过期提示

3.CSS Code: (Add code below in custom CSS style)

Tips:This article was last updated in2024-07-29 21:05:41Some articles are time-sensitive, if there are errors or have expired, please be belowmessageor contactkuso55555
© Copyright Notice
THE END
If you like it, support it
LV69 suncosmos
The wise man is always a good listener.
or
comments A total of 21 articles

Please log in to post a comment