文章底部的版权声明是一个持久不衰的话题,这次wordpress区块分享的渐变背景版权声明卡片可以放在日志页底部,里面还有几个快捷链接,方便您的访客快速找到自己常用的链接。
- 代码来源:详情
卡片长这样:
如何使用?
方案一、
将下方代码复制到您的主题根目录下的functions.php
的<?php
下面。
//在所有文章底部添加自定义内容
function add_after_post_content($content) {
if(!is_feed() && !is_home() && is_singular() && is_main_query()) {
$content .= '
<style type="text/css">
.content-copyright {
color: #fff !important;
display: flex;
justify-content: center;
flex-flow: column;
margin-top: 20px;
padding: 20px;
border-radius: 6px;
position: relative;
/*background-image: linear-gradient(-90deg, #29bdd9 0%, #276ace 100%);*/
background-image: linear-gradient(120deg, #48c6ef 0%, #6f86d6 100%);
box-shadow: 0 0 0.0625rem 0 rgba(8, 11, 14, .06), 0 0.1875rem 0.1875rem -0.0625rem rgba(8, 11, 14, .1), 0 0 0.1875rem 0 rgba(8, 11, 14, .02);
text-align: center;
font-size: 14px !important;
margin-bottom: 0 !important;
}
.content-copyright a {
color: #fff !important;
border-bottom: 0px !important;
}
.content-copyright p {
font-size: 14px !important;
margin: .5em 0;
}
@media screen and (max-width: 768px) {
.content-copyright {
margin: 12px -12px 0;
}
}
</style>
<div class="content-copyright">
<p>有些资源有时效性,且用且珍惜。</p>
<p>文章均为<a href="#">Npcink</a>整理分享,仅作个人学习使用,转载请注明链接,谢谢!</p>
<p>
<a href="#" target="_blank" rel="noopener noreferrer">N</a>| <a
href="#" target="_blank" rel="noopener noreferrer">N</a>| <a
href="#" target="_blank" rel="noopener noreferrer">N</a>| <a
href="#" target="_blank" rel="noopener noreferrer">N</a>
</p>
</div>
';
}
return $content;
}
add_filter('the_content', 'add_after_post_content');
方案二、
点击下方的Demo按钮,右击鼠标查看源代码,根据代码注释复制代码到自己需要的地方,例如古登堡的HTML区块或是小工具里面的“自定义HTML”,另外,记得看代码注释哦(。・∀・)ノ
感谢站长😍
谢谢站长分享
WO YAOKAN A