WordPress.org

Ready to get started?Download WordPress

Forums

Twitter sidebar hyperlink problem? (5 posts)

  1. metserve
    Member
    Posted 4 years ago #

    All of the Twitter posts on the side bar are not hyperlinking correctly?

    They appear as

    http://www.domainname.com/"http://twitter.com/name

  2. metserve
    Member
    Posted 4 years ago #

    Ooops .... this should be in the 'fusion' theme section!

  3. depoll
    Member
    Posted 4 years ago #

    I managed to fix this by replacing a method in functions.php:

    // theme widget: Twitter
    function fusion_TwitterWidget($args){
     extract($args);
     echo $before_widget;
     print $before_title.__('<a href="http://www.twitter.com/'.get_option('fusion_twitterid').'">Twitter posts</a>','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);
      $feed = html_entity_decode($feed);
      $clean = explode("<content type=\"html\">", $feed);
      $amount = count($clean) - 1;
      print '<ul id="twitterupdates">';
      for ($i = 1; $i <= $amount; $i++) {
       $cleaner = explode("</content>", $clean[$i]);
       print '<li class="entry">';
       echo $cleaner[0];
       print '</li>';
      }
      print '</ul>';
     }
    
     echo $after_widget;
    }

    Note: I also made the title of the widget link to your twitter id's twitter page :). Hopefully this helps!

  4. Kieran McCarthy
    Member
    Posted 4 years ago #

    @depoll

    Thank you for this fix.... :)

    Kieran

    http://www.kmcgraphics.com

  5. giubilo00
    Member
    Posted 4 years ago #

    Hi!
    I'm using the fusion theme, and I like it very much, but I have a problem with twitter widget, infact i receive this error in my homepage.

    TWITTER POSTS

    Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/mhd-01/www.gsurbinospeleo.it/htdocs/blog/wp-content/themes/fusion/functions.php on line 646
    
    Warning: file_get_contents(http://search.twitter.com/search.atom?q=from:gsurbino&rpp=2) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/mhd-01/www.gsurbinospeleo.it/htdocs/blog/wp-content/themes/fusion/functions.php on line 646

    I'have tried to use another widget and it works well, but I don't like it.

    Could you help me?
    Thanks
    Bye

Topic Closed

This topic has been closed to new replies.

About this Topic