wordpress文章页面添加版权信息的四种方法

善意的转载者既使没有看到版权信息也会主动自觉地添加上原文出处,但是大部分站长都是直接采集的,如果我们在网站文章的尾部添加一个版权信息,大部分站长采集后也不回去特意把每篇采集来的文章都去除版权,所以为文章添加一个版权信息和转载提示还是非常有必要的。本文实例讲述了WordPress文章底部去除与添加版权信息的方法。分享给大家供大家参考。具体分析如下:

这里参考一些网友的版权声明信息,具体更改方法为:

外观>>编辑“single.php”文件,找到类似“div class="content"”的源码,在下面相应位置添加.

方法1

<p>本文链接: <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"> 
<?php the_permalink(); ?></a><br/>转载请注明转载自:<a href="">SeaRu</a></p>

方法2

本文链接:<a rel="bookmark" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php echo wp_get_shortlink(); ?></a> 
订阅本站:<a title="SeaRu" href="" rel="external nofollow">http://feed. searu.org</a></div> <br/> 
转载请注明来源:<a title="SeaRu" href="" rel="external nofollow">SeaRu</a> <a rel="bookmark" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">《<?php the_title(); ?>》</a>
<pre lang="php" line="0" escaped="true" >

方法3

本文由<?php the_author_posts_link(); ?>,转载请注明转自:<?php bloginfo('name'); ?><a href="<?php echo get_settings('home'); ?>"><?php echo get_settings('home'); ?></a>;
如果你觉得本博内容不错,欢迎 <a href= target="_blank">订阅我的博客</a>,以便第一时间了解本博更新内容;
本文链接:<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_permalink(); ?></a>

方法4

将以下代码加入到functinos.php即可在每篇文章的末尾输出一个转载和版权提示,

function feed_copyright($content) {
    if(is_single() or is_feed()) {
        $content.= '<div>转载请注明来源:<a rel="bookmark" title="'.get_the_title().'" href="'.get_permalink().'">'.get_the_title().'</a></div>';
        $content.= '<div>本文链接地址:<a rel="bookmark" title="'.get_the_title().'" href="'.get_permalink().'">'.get_permalink().'</a></div>';
        $content.= '<div>订阅本站:<a title="wordpress建站" href="http://www.v7v3.com/f/?t=dy">http://www.v7v3.com/f/?t=dy</a></div>';
        $content.= "</blockquote>";
    }
    return $content;
}
add_filter ('the_content', 'feed_copyright');

将以上代码加入到 functinos.php即可在每篇文章的末尾输出一个转载和版权提示,当然你可以利用这种方法在文章尾部添加广告。

您可能感兴趣的文章:


▪ 最全最佳wordpress插件汇总推荐

▪ Youpzt-optimizer插件你的WordPress网站优化利器

▪ WordPress免插件实现随机文章

▪ WordPress免插件实现热门文章

▪ Wordpress自定义pre样式DIY代码高亮

▪ wordpress函数:get_permalink()获取文章页面的固定链接

▪ WordPress浏览次数统计插件:WP-PostViews Plus

▪ wordpress标签云显示文章数量两种方法

▪ WP-Optimize你的wordpress数据库优化保姆

▪ 百度官方插件sitemap和Baidu Sitemap区别和使

猜你喜欢

转载自blog.csdn.net/zcp528/article/details/108333820