Last 3 tweets in WordPress

Posted on 2010-08-25
Last Modified: 2012-05-10
I am current using the wp_echoTwitter code to show the last tweet on my blog. I am looking to show the last 3 tweets.

I have this in my functions.php file:
function wp_echoTwitter($username){


     $tweet = fetch_rss("" . $username . "&rpp=1");

     echo $tweet->items[0]['atom_content'];

Open in new window

And I have this added to my sidebar
		<h3><?php wp_echoTwitter('twitteruser'); ?></h3>
		<h2><a href="">Follow twitteruser on Twitter</a></h2>

Open in new window

Any ideas?

Question by:vertigogroup
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 33522414
All you have to do is change the value of rrp to however many tweets you want to show, so-

$tweet = fetch_rss("" . $username . "&rpp=1");

should be changed to-

$tweet = fetch_rss("" . $username . "&rpp=3");


Author Comment

ID: 33522530
I tried that but it still showed only 1. Do I need to wait an hour before it displays?

Accepted Solution

wuff earned 500 total points
ID: 33523861
You are still accessing the first one. You need to loop them through. Check this update of the function:

Author Closing Comment

ID: 33524089
Works like a charm. Thanks!

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Go t…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question