WordPress.org

Ready to get started?Download WordPress

Forums

Display Last Tweet function - search results (1 post)

  1. kdubya16
    Member
    Posted 2 years ago #

    I haven't been able to find an answer to this question and thought I may get some good answers here....

    I have this solution in place for displaying my latest tweets, but my Twitter ID is not being found. I have tried using other Twitter user names and it works - why wouldn't I be showing up in the search results?

    This code is in my functions.php file:

    function displayLatestTweet($twitterID){
         include_once(ABSPATH.WPINC.'/rss.php');
         $latest_tweet = fetch_rss("http://search.twitter.com/search.atom?q=from:" . $twitterID . "&rpp=1");
         echo $latest_tweet->items[0]['atom_content'];
    }

    And this in my template file:
    <p><?php displayLatestTweet('twitter_name'); ?></p>

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic