Posts Tagged twitter
WordPress fusion theme: twitter widget link problem
The twitter sidebar widget in the fusion theme of wordpress shows weird in Firefox browser, due to the encoding of the double quotes in the href attribute. For example, a link from a twitter post shows like this in source:
Safari in quite intelligent regarding this and displays the links right.
A look in the code revealed that the output from twitter webservice call is not completely decoded. The function fusion_TwitterWidget() in wp-content/themes/fusion/functions.php looks like this after an easy fix:
-
// theme widget: Twitter
-
function fusion_TwitterWidget($args){
-
extract($args);
-
echo $before_widget;
-
print $before_title.__(‘Twitter posts’,'fusion’).$after_title; ?>
-
-
<?php
-
$username = get_option(‘fusion_twitterid’);
-
$limit = get_option(‘fusion_twitterentries’);
-
if($username<>”) {
-
$feed = file_get_contents("http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=" . $limit);
-
-
// joyd: fix for the broken hyperlinks of twitter plugin due to encoded quotes
-
// $feed = str_replace("<", "< ", $feed);
-
// $feed = str_replace(">", ">", $feed);
-
-
print ‘<ul id="twitterupdates">’;
-
for ($i = 1; $i < = $amount; $i++) {
-
print ‘<li class="entry">’;
-
echo $cleaner[0];
-
print ‘</li>’;
-
}
-
print ‘</ul>’;
-
}
-
-
echo $after_widget;
-
}
Thanks a lot to Francesco to point this out !
Recent Comments