Create a Page Specifically Used to Display Tweets
Create a Page Specifically Used to Display Tweets
Sometimes, Twitter becomes so central to the success of a website that it deserves its own WordPress page. While this might seem a bit intimidating to accomplish at first, it’s actually very easy. WordPress is simply told to read the Twitter account’s RSS feed and print its content into the page.
To accomplish this, create a new PHP template file called tweets.php and paste the following code into that file:
< ?php /* Template Name: A Page for Tweets */ get_header(); include_once(ABSPATH.WPINC.’/rss.php’); wp_rss(‘http://twitter.com/statuses/user_timeline/RSSfilename.rss’, 35); get_sidebar(); get_footer(); ?>
The template above will pull in the existing header, footer, and sidebar, largely completing the site’s design. It will fill that design in with the last 35 tweets that a user posted. Be sure to edit the RSS feed URL to reflect the proper Twitter account before saving the file.