如何美化WordPress底部版权声明?

很多人喜欢在文章底部添加一些有趣的信息,比如添加一些转载声明及加群链接,那么如何美化WordPress底部版权声明?

如何美化WordPress底部版权声明? (https://www.wp-admin.cn/) WordPress开发教程 第1张
实现方法

将以下代码添加至主题根目录的functions.php文件<?php下,然后根据代码中的提示换上自己需要的内容以及图片即可。

//在所有文章底部添加自定义内容

function add_after_post_content($content) {

if(!is_feed() && !is_home() && is_singular() && is_main_query()) {

$content .= ‘

<style>

.hh_wenzhangjieshu{padding:30px 0;text-align: center;border-top: double rgba(70, 139, 230, 0.14);}

.hh_wenzhangjieshu img{border:0;text-align:center;box-shadow:none;}

.hh_content_footer{width:100%;height:200px;box-shadow: 0 0px 1px #d9e0eae3;margin-top:0px}

.hh_content_footer .item_top_left{padding:20px;float:left;}

.hh_content_footer .item_top_left p{line-height:14px;font-weight:600;font-size:12px;padding-left: 7px;}

.hh_content_footer .item_top_left h3{color:#f7516c;font-size:18px;font-weight:600;}

.hh_content_footer .item_top_right{float:right;padding: 20px 50px 20px 20px;}

.hh_content_footer .item_top_right .hh_erweima{width:80px;height:80px;background:#f7f7f7;float:left;margin-right:15px;margin-top:15px;padding: 6px;}

.hh_content_footer .item_top_right .hh_qqqun{float:left;margin-left: 20px;}

.hh_content_footer .item_top_right .hh_qqqun img{width: 80px;height: 80px;margin: 0 51px 0 0;float: left;}

.hh_content_footer .item_top_right .hh_qqqun .spanQ1{background:#f4f8ff;}

.hh_content_footer .item_top_right .hh_qqqun .spanQ3{margin: 20px 0 10px;}

.hh_content_footer .item_top_right .hh_qqqun .spanQ2{margin: 10px 0 0;}

.hh_content_footer .item_top_right .hh_qqqun a{display:block;background:#f4f8ff;line-height:30px;border-radius: 15px;margin-top:15px;text-align:center}

.hh_content_footer .item_top{width:100%;height:118px;}

.hh_content_footer .item_bottom {width:100%;float: right;}

.hh_content_footer .item_bottom .item_bottom_left{float:left;margin-left: 27px;}

.hh_content_footer .item_bottom .item_bottom_left a{float:left;text-align: center;padding: 7px 20px;display:block;margin-right:20px;color:#fff;font-weight:600;border-radius: 4px;position: relative;top:-5px;}

.hh_content_footer .item_bottom .item_bottom_right{float:right;font-weight:600;color:#666;margin-right: 44px;}

.hh_content_footer .item_bottom:before{width:100%;height:1px;background: #e6f0ff;display:block;margin-bottom: 20px;}

.hh_content_footer .hh_button_jianbian01{background:linear-gradient(to left,#70a4fe,#4583ec)}

.hh_content_footer .hh_button_jianbian02{background:linear-gradient(to left,#fe9369,#f7516c)}

.hh_content_footer .hh_button_jianbian03{background:linear-gradient(to left,#c867ff,#8a92fb)}

.hh_content_footer .hh_button_jianbian01:hover{background:linear-gradient(to left,#4583ec,#70a4fe)}

.hh_content_footer .hh_button_jianbian02:hover{background:linear-gradient(to left,#f7516c,#fe9369)}

.hh_content_footer .hh_button_jianbian03:hover{background:linear-gradient(to left,#8a92fb,#c867ff)}

@media (max-width:767px){

.hh_content_footer{height:360px;}

.hh_content_footer .item_top_right{float: none;position: relative;top: -23px;}

.hh_content_footer .item_bottom{margin-top:30px}

.hh_content_footer .item_bottom .item_bottom_right{float:none;margin-top: 61px;text-align: center;}

}

.hh_qqqun a img{position: relative;top: 7px;right: 2px;}

</style>

<div style=”text-align: center;” class=”hh_wenzhangjieshu”><img src=”图片URL”/></div>

<div class=”hh_content_footer”>

<div class=”item_top”>

<div class=”item_top_left”>

<h3>【云模板】温馨提醒:</h3>

<p>本站所有文章都可以进行提问,有问必答,欢迎骚扰!</p>

<p>如果您喜欢我们,请收藏本站,您将得到更好的服务。 如有侵权请邮件与我们联系处理。 </p>

</div>

<div class=”item_top_right”><div class=”hh_qqqun”>

<br>

<img src=”图片URL”>

<!– <span class=”spanQ1 spanQ3″>QQ交流群</span>

<br>

<span class=”spanQ1 spanQ2″>QQ交流群</span> –>

</div></div>

</div>

<div class=”item_bottom”>

<div class=”item_bottom_left”>

<a href=”/bubble” class=”hh_button_jianbian01″ target=”_blank” rel=”noopener noreferrer”>投诉建议</a>

<a href=”/vips” class=”hh_button_jianbian02″ target=”_blank” rel=”noopener noreferrer”>购买会员</a>

<a href=”/shop” class=”hh_button_jianbian03″ target=”_blank” rel=”noopener noreferrer”>服务商城</a>

</div>

<div class=”item_bottom_right”>

© 转载请联系作者,私自转载视为侵权!

</div>

</div>

</div>’;

}

return $content;

}

add_filter(‘the_content’, ‘add_after_post_content’);

相关推荐

发表回复

房先生
我们将24小时内回复。
2024-05-11 05:25:20
您好,有任何疑问请与我们联系!
您的工单我们已经收到,我们将会尽快跟您联系!
[QQ客服]
2781198
加我微信
[电话联系]
13585372227
[电子邮件]
chaoneo@163.com
取消

选择聊天工具: