摘要:相信大多数博主亲自写的日志或博客都会添加一些COPYRIGHT声明,别人转载时带上链接地址,增加博客在网络世界的曝光率。在这之前,reille blog一直是手动在日志开头添加文章链接的。觉着麻烦,所以增加了自动添加日志版权声明功能。
网上已有很多介绍如何增加自动添加日志版权声明的文章了,不过,并不适合suffusion主题。在分析源代码并多次试验后,终于在suffusion主题中添加成功,具体效果见本文末尾。作为分享,本文介绍了在suffusion主题中如何实现自动添加日志版权声明功能。
在suffusion主题下functions.php文件末尾添加如下源代码:
// add start by gyr 2012.03.30
function wp_add_copyright_info($content)
{
global $post;
if(!$post->ID){
return;
}
$copyright_info = "";
$copyright_info = '
<div style="border:1px dashed #ddd; padding:10px; margin:10px 0;line-height:26px;border-radius: 3px;">
<div>
» <b style="color: #0000ff">文章出处:</b>
<a title="reille blog" href="http://velep.com" rel="external nofollow">reille blog</a>
<span style="color: #0000ff">, 除非特别声明,均为原创作品,转载请注明出处</span>
</div>
<div>
» <b style="color: #0000ff">本文地址:</b>
<a href="'.get_permalink($post->ID).'" rel="external nofollow">'.get_permalink($post->ID).'</a>
</div>
</div>
';
if (is_single()||is_feed())
{
$content = $content . $copyright_info;
}
return $content;
}
add_filter('the_content', 'wp_add_copyright_info', 99);
// add end by gyr 2012.03.30
述代码add_filter函数中99,表示在日志中显示的优先级,数字越小,在日志中的显示位置越排前,请根据你的要求进行设置。
» 文章出处:
reille博客—http://velep.com
, 如果没有特别声明,文章均为reille博客原创作品
» 郑重声明:
原创作品未经允许不得转载,如需转载请联系reille#qq.com(#换成@)


找到一个类似的同行。正好想了解下goahead。我已经下到goahead 3源码,不像你所说的下不到
goahead 3源码,不是收费了么?哪下载的?
我是偶然搜到的,这个地址http://embedthis.com/products/goahead/index.html