So, people are starting to leave comments with their websites linked on the site. Now this is all part of back linking and ways to get your own site seen by more people. However, I wanted people to be able to click on their link without leaving my page.
So after searching and searching and trying many different ways that didn’t work, I finally found a page that had the answer. Here is the simplified version:
In your WordPress admin page go to Appearance then select Editor
Next find your functions.php and add the following code:
// Make comment author link URL open in new window
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 = "$author";
return $return;
}
add_filter('get_comment_author_link', 'comment_author_link_window');
I added the above code this right before the end of the functions.php, as in above the following:
/* End of file functions.php */
/* Location: ./functions.php */
It works great for me.
JD
// Make comment author link URL open in new window
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’);