为了有一个更好的用户体验,Wordpress默认的用户评论链接是在同一个窗口中打开的,但是对于国内来说,这种链接打开方式可能不太符合国内用户的使用习惯。
所以有些主题已经链接打开方式进行了优化。如果你的Wordpress还没有优化,您可以按照以下方法进行优化。
分为两种情况,就看你的博客主题调用那个functions.php文件了。
第一种情况:您的博客调用的是wordpress的函数,那么在在wp-includes\comment-template.php中找到如下代码:
function get_comment_author_link() {
/** @todo Only call these functions when they are needed. Include in if... else blocks */
$url = get_comment_author_url();
$author = get_comment_author();
if ( empty( $url ) || 'http://' == $url )
$return = $author;
else
$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
return apply_filters('get_comment_author_link', $return);
}
在红色标注的a标签内添加target='_blank'
第二种情况:如果你的博客调用的是主题自带的functions.php函数,那请用这种方法:
打开主题文件中的functions.php函数,搜索external nofollow,在a标签内添加target='_blank'即可
如果你不确定你的博客调用的是那个functions.php函数,你可以两处同时修改了。