Hi!
Using the Twitter widget as a shortcode on a page.
How do I get links in the tweets to be targeted to blank?
Thanks!
Hi!
Using the Twitter widget as a shortcode on a page.
How do I get links in the tweets to be targeted to blank?
Thanks!
Hey Pamino,
You'll need to open up class-framework-widgets.php which is inside the framework>php folder and replace lines 262-266 with the following:
$text = preg_replace('/\b([a-zA-Z]+:\/\/[\w_.\-]+\.[a-zA-Z]{2,6}[\/\w\-~.?=&%#+$*!]*)\b/i',"<a href=\"$1\" target=\"_blank\" class=\"twitter-link\">$1</a>", $text);
$text = preg_replace('/\b(?<!:\/\/)(www\.[\w_.\-]+\.[a-zA-Z]{2,6}[\/\w\-~.?=&%#+$*!]*)\b/i',"<a href=\"http://$1\" target=\"_blank\" class=\"twitter-link\">$1</a>", $text);
$text = preg_replace("/\b([a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]*\@[a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]{2,6})\b/i","<a href=\"mailto://$1\" target=\"_blank\" class=\"twitter-link\">$1</a>", $text);
$text = preg_replace("/#(\w+)/", "<a class=\"twitter-link\" href=\"http://search.twitter.com/search?q=\\1\" target=\"_blank\">#\\1</a>", $text);
$text = preg_replace("/@(\w+)/", "<a class=\"twitter-link\" href=\"http://twitter.com/\\1\" target=\"_blank\">@\\1</a>", $text);Excellent!
Thanks!
You must log in to post.