Get FREE lessons from "Hack It Easy Hacking Course"

Enter your email and instantly receive the lessons in your inbox for free

Wednesday, July 28, 2010

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

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.

01
02
03/*
04Template Name: Twitter page
05*/
06
07get_header();
08
09include_once(ABSPATH.WPINC.'/rss.php');
11
12get_sidebar();
13get_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.

0 comments:

x

   First Name:
* Your Email Address:
 

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More