之前的文章我都是手动添加一些关联链接和版权信息,每次都得返回编辑其他文章查看代码,想着一劳永逸的解决这个问题,于是在网上找到了一些方法,针对在workpress文章底部自动添加版权信息的段落。
值得注意的是,需要编辑主题文件夹下的funtions.php文件,添加以下代码就可以自动添加版权信息:
//WordPress Article copyright statement
add_filter ('the_content', 'fanly_copyright');
function fanly_copyright($content) {
if(is_single() or is_feed()) {
$content.= '<p>本文由<a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('name').'</a>原创,转载请注明:<a title="'.get_the_title().'" href="'.get_permalink().'" target="_blank">'.get_permalink().'</a></p><p>文章同步更新在:<a title="Busy-andyhsia" href="https://busy.org/@andyhsia" target="_blank">Busy-andyhsia</a></p>';
return $content;
}
}
如果朋友们也采用的话,记得替换掉代码中的链接和相关个人文本。
Posted from my blog with SteemPress : https://chakela.me/how-to-auto-add-copyright-info-of-content/
Congratulations @andyhsia! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit