Create a Page that shows twitter updates on your blog/site

July 29, 2010 Shashank Agarwal Blog 1 minute, 6 seconds Edit This Article

Twitter is the best way to publicize and advertise your blog or site and to stay in touch with followers. We already showed you how to display your latest tweet on your blog, in your sidebar for example. Another good way to introduce readers to your Twitter updates is to create a dedicated page for displaying your tweets, using the powerful “Page template” WordPress option.
To perform this hack, you need to know how to create and use page templates. If you’re not familiar with this, this article will tell you all you need to know.
Here’s the code to create a Twitter page template. Paste it in a new file, name the file something like twitter-page.php, for example, and then add it to your blog.

view source

print?

01 ``

02

03 /*

04 Template Name: Twitter page

05 */

06

07 get_header();

08

09 include_once``(ABSPATH.WPINC.``'/rss.php'``);

10 wp_rss(``'<a href="http://twitter.com/statuses/user_timeline/15985955.rss">http://twitter.com/statuses/user_timeline/15985955.rss</a>'``, 20);

11

12 get_sidebar();

13 get_footer();

14 ?>

This code uses the wp_rss() function from WordPress core, which is an RSS reader. In the first argument I pass my Twitter RSS feed, and in the second argument I determine the number of entries to display.

Go to our new site- shankee.com

Comments