wordpress程序主题有一些文章底部是没有自带的版权以及原创文章的说明,今天危笑云资源就分享只需要
一串代码轻松搞定文章的底部版权说明问题!!!!
把以下代码添加到你 WordPress 当前主题的 functions.php 文件中即可:
![图片[1]-如何给wordpress程序的文章添加原创文章链接以及说明-危笑云资源网](https://yun.luoye520.cn/wp-content/uploads/2020/12/8YD6IGBNM1KSFXNKJZQN.png)
//WordPress 文章版权申明
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>原创文章,转载必须以链接形式标明本文链接</p>';
$content.= '<p>本文链接:<a title="'.get_the_title().'" href="'.get_permalink().'" target="_blank">'.get_permalink().'</a></p>';
return $content;
}
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容