Have you ever wanted to add an external RSS feed to your WordPress blog? This is a great way to promote one of your other blogs (if it is in a similar niche) on a more popular site you run.
Most of you will probably remember that about a month ago we finally got around to launching our WordPress Forums, which has an RSS feed associated with it. In order to cross-promote our forums on this site, I wanted to display our most recent forum posts in the sidebar here at WordPress Hacks.
In order to accomplish this, I grabbed the following code from Jean’s post over at Smashing Magazine:
<?php include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('http://wpforums.com/external.php?type=RSS2', 5); ?>
It takes the rss.php file that is built into WordPress (used for widgets). In this code it is set to display the most recent 5 posts from the RSS feed “http://wpforums.com/external.php?type=RSS2.”
Here is how it looks:
I have gone ahead and added this to our WordPress Code page for easy reference.



















I think there is native widget for that as well?
I use “KB Advanced RSS” plugin – for showings custom software updates feed in my sidebar. Needed something customizable to showing two different links on each item (post and download).
@ Rarst – Yes, there is a widget for RSS feeds, though this gives you a little more control and can be placed anywhere (not forced to use sidebar or other widget enabled areas).
Maybe I’m weird, but I prefer hard coding things.
I’ve tryed to use it fetching another wordpress url but it gives an error saying the feed probably doesn’t exist but it does…
I just discovered your blog and just finished reading it page to page. Thanks for this nice tips
very informative site, i will to add another RSS on my site.. thanks for the tip. keep up the good work.
great – just added it to my singlepost.php and page template and it works 100%
Thanks a million
Thanks for the tip. I assume that this piece of code will have to be added to the template file, right. My problem is that I only want the feed to show up in the body of one page (not all my pages). Any idea how I can do that?
Is it possible to change the output to show more things like text, images etc…
Your method is described more easily. I have also written a post on this topic on my blog which is called Wordpress: Displaying External RSS Feeds
But I have redirected visitors to SimplePie which is at the core of the feed fetching mechanism built in wordpress.
Is it possible to get the image from the posts too ?