Blog

The Haycroft Media Blog covers all aspects of website design and development from the web browsers being used through to the standards that govern the world wide web. As a website design and development company, it is imperative that we keep abreast of all the latest news and happenings in our field, and here we present the major stories along with tutorials, tips and other web-programming related items.

TwitterTools – open links in external window

Our site makes use of the Twitter Tools plugin, but with some minor tweaks

The only links that Twitter Tools displays with our set-up are the bit.ly links, the link to the specific tweet (e.g. “1 hr ago”) and the “More Updates…” link. All of these links will open their target in the same window, but we wanted them to open an external window so the user remains on the site.

To do this, you need to locate the plugin’s main coding. This is currently at:
wp-content/plugins/twitter-tools/twitter-tools.php

Now make the folllowing changes:

“More Updates Link”: Change Line 812:

$output .= '	<li class="aktt_more_updates"><a href="'.aktt_profile_url($aktt->twitter_username).'">'.__('More updates...', 'twitter-tools').'</a></li>'."\n";

To:

$output .= '	<li class="aktt_more_updates"><a href="'.aktt_profile_url($aktt->twitter_username).'" target="_blank">'.__('More updates...', 'twitter-tools').'</a></li>'."\n";

“Time Display Link”: Change Line 879:

$output .= ' <a href="'.aktt_status_url($aktt->twitter_username, $tweet->tw_id).'" class="aktt_tweet_time">'.$time_display.'</a>';

To:

$output .= ' <a href="'.aktt_status_url($aktt->twitter_username, $tweet->tw_id).'" class="aktt_tweet_time" target="_blank">'.$time_display.'</a>';

“Bit.ly links”: Change Line: 881:

return $output;

To:

$output = str_replace('rel="nofollow">', 'target="_blank" rel="nofollow">', $output);
return $output;
[ Back ]
Posted on Tuesday, January 12th, 2010, Filed under php, wordpress