Last 3 tweets in WordPress

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?

Who is Participating?
wuffConnect With a Mentor Commented:
You are still accessing the first one. You need to loop them through. Check this update of the function:
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");

vertigogroupAuthor Commented:
I tried that but it still showed only 1. Do I need to wait an hour before it displays?
vertigogroupAuthor Commented:
Works like a charm. Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.