有两处可以添加,分别是single.php文件或者模板主题的content-single.php文件。
在single.php中实现如下:
<p>本文链接: <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_permalink(); ?></a><br/>转载请注明转载自:<a href="">168itw</a></p>
或者:
<p>转载请标明出处:<a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></p>
<p>本文地址:<a href="<?php the_permalink() ?>"><?php the_permalink() ?></a></p>
然后可以自定义css样式,给版权添加样式。
在function.php实现如下:
//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;
}
}