How to integrate your Twitter tweets in your Wordpress theme

I have been doing a lot of searching for a way to integrate Twitter tweets in my themes without the help of any plugin. If you are reading this, I suppose you are looking for the same thing. Here it is how:

Step 1. Where ever you want your tweets listed (sidebar.php, single.php, footer.php) insert these 2 lines of code:

1
2
<?php include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('http://twitter.com/statuses/user_timeline/48605233.rss', 3); ?>

The first line calls the Wordpress built-in RSS functions.
The second line prints your feed. The first parameter is the feed URL and the second one is the number of feed items to list.

Step 2. Go to you Twitter profile http://twitter.com/yourprofile and in the sidebar search for “RSS feed of YourUserName’s tweets”. Right click and copy the link. The link should be something like: http://twitter.com/statuses/user_timeline/87299070.rss. The number is your Twitter Feed ID number.

Step 3. In the code above replace the URL with the URL you have copied from Twitter.

Save your work and enjoy!

Reference:http://www.smashingmagazine.com/2008/12/02/10-useful-rss-hacks-for-wordpress/

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

Your last post will show together with your comment.

Please input your Twitter username if you want this post visitors to follow you.
Only needs to be added once (unless you change your username). No http or @
Twitter