当前位置:首页>WordPress>7b2-添加文章底部版权代码

7b2-添加文章底部版权代码

代码放在b2子主题文件目录下“functions.php”中

//添加文章末尾版权信息  
function copyright($content) { 
    // // 文章最后更新时间开始
    // $u_time = get_the_time('U'); 
    // $u_modified_time = get_the_modified_time('U'); 
    // $custom_content = ''; 
    // if ($u_modified_time >= $u_time + 86400) {
    // $updated_date = get_the_modified_time('Y年m月d日 G时i分s秒'); //这里设置时间显示格式,可自由调整。
    // $custom_content .= '本文最后更新于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,请在下方留言或联系辉哥:<b>m@haah.net</b>';  
    // }
    // // 文章最后更新时间结束
    // if(is_single()||is_feed()) {  
    //     $content1.='<div class="open-message"  style="border-radius: 20px; background: #f8f9fb;color: #3860f4; padding: 15px 29px 15px 15px; font-size: 13px; line-height: 28px;"><i class="fa fa-bullhorn"></i>文章链接:<a href="'.get_permalink().'" title="'.get_the_title().'">'.get_permalink().'</a><br/>文章标题:<a rel="bookmark" title="'.get_the_title().'" href="'.get_permalink().'">'.get_the_title().'</a><br/>文章版权:辉哥博客 (haah.net) 所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!<br/>';
    //     $content .= $content1 .= $custom_content .= '</div>';
    // }  
    $updated_date = get_the_modified_time('<北京时间>Y年m月d日 G时i分s秒'); //这里设置时间显示格式,可自由调整。
    if(is_single()||is_feed()) {  
        $content.='<div class="open-message"  style="border-radius: 20px; background: #f8f9fb;color: #009393;padding: 15px 29px 15px 15px; font-size: 13px; line-height: 28px;"><i class="fa fa-bullhorn"></i>文章链接:<a href="'.get_permalink().'"><span style="color:#FF9900;">'.get_permalink().'</span></a></a><br/>文章标题:<a href="'.get_permalink().'"><span style="color:#E56600;">'.get_the_title().'</a><br/>文章版权:
       华易资讯(huayidw.cn) 所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!<br/>本文最后更新发布于<code>'. $updated_date . '</code>,某些文章具有时效性,若有错误或已失效,<span style="font-size:14px;">请在下方</span><a href=".get_permalink()." #comment=""><b><span style="color:#E53333;font-size:14px;"<a>留言</span></b></a><span style="font-size:14px;">或联系客服</span></span><span style="font-size:14px;">:</span><a href="http://wpa.qq.com/msgrd?v=3&uin=1043956&site=qq&menu=yes"><b><span style="color:#E53333;font-size:14px;">点击跳转</span></b></a><span style="color:#E53333;font-size:14px;">';
    }
return $content;  
}  
add_filter ('the_content', 'copyright');
//添加文章末尾版权信息结束 

部分文章/资源来源于网络,文章标题下部均已标注来源,如有侵权,请点击此处联系客服进行删除,本站将会在第一时间内进行处理! 

如果您要搬运本站文章,请在文章底部标注。侵删请致信:663829289@qq.com

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系本站进行处理。

图床支持:https://space.simao58.cn/

如果文章帮助到您,还请您点击一下广告支持本站一下!

给TA打赏
共{{data.count}}人
人已打赏
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索