This, simply put, is the main reason why you wouldn't want visitors to leave your site completely. Unfortunately, most Wordpress blog theme templates don't set this up for you automatically. If you're not sure if yours does, just go to one of your single posts and click on one of your comment author links. If it removes your blog completely from the browser, then you don't have the target="_blank" attribute set up properly.
Thankfully, I came across a really cool site that explains exactly how to set up your Wordpress theme's function.php file to open comment author links in a new window.
If you're not concerned about all the ins and outs of how to accomplish this, just follow these instructions:
Once logged into your Wordpress admin area, go to Appearance, then Editor. Once there, find your functions.php file. Click on it, and simply paste the following php code at the bottom of the file before the php closing tag (looks like this "?>".
// 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');
Hope this code is of use to you.
0 comments:
Post a Comment