这几天叶子给这款主题做了很多修改顺带也给文章页末尾增加转载注明来源功能,原因就是因为老感觉文章页太空了。所以不自觉的就给博客添加上了这个功能。顺带也把这个教程分享给大家。教程很简单,只有两个步骤。
第一步,先把下面的代码加入到functions.php里面去(里面的内容大家可以根据自己的需求进行修改)
add_filter ( 'the_content', 'wp_copyright' );
function wp_copyright($content) {
if (is_single ()) {
$content .= '</code></pre>
<p class="corpright">原文链接:<a href="'.get_permalink().'">'.get_the_title().'</a>,转载请注明来源!</p>
<pre><code></code></pre>
'; } return $content; }
第二步,把下面的代码加入到主题的style.css文件当中(这个css样式大家可以改成自己喜欢的样子,叶子在这里只给大家参考用)
.corpright{
background-color: #EEE;
color: #AAA;
padding: 5px 0px 5px 0px;
font-size: 12px !important;
text-align: center;
}
.corpright a{
color: #AAA;
}
.corpright a:hover{
color: #FF5E52;
.post-like a{
text-decoration: none;
color: #FFF !important;
height: 45px;
min-width: 120px;
max-width: 100%;
opacity: 0.8;
text-align: center;
display: inline-block;
line-height: 45px;
background-color: #FF5E52;
border-radius: 3px;
cursor: pointer;
font-size: 15px;
float: left;
}
然后就成功了,就是这么简单。
演示效果如本文转载说明
支持一下