Jean-Baptiste Jun 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.
/*
Template Name: Twitter page
*/
get_header();
include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('http://twitter.com/statuses/user_timeline/15985955.rss', 20);
get_sidebar();
get_footer();
?>
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.
Sunday, May 24, 2009
How To : Create a Twitter page on your WordPress blog
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment