日志标签:新页面打开网站

wp:在新页面打开评论者网站

分类:折腾日期:2010-08-10 - 11:38:17评论:8条作者:老谢

很简单,把以下代码,复制到主题的function.php里面即可

function comment_author_link_window() {
global $comment;
$url = get_comment_author_url();
$author = get_comment_author();
 
if ( empty( $url ) || 'http://' == $url )
$return = $author;
else
$return = "<a href='$url' rel='external nofollow' target='_blank'>$author</a>";
return $return;
}
add_filter('get_comment_author_link', 'comment_author_link_window');