How to: Display any rss feed on your WordPress blog

Do you ever wanted to be able to display any rss feed on your WordPress blog? If yes, here’s a simple code that will get that thing done. Do you know that WordPress have a function, called wp_rss(), which is nothing else than a built-in rss reader?

Here's the simple code to add where you want the rss to be displayed (Personally, I'd use my sidebar, my footer or a page template):

<?php include_once(ABSPATH . WPINC . '/rss.php');
wp_rss('http://feeds.feedburner.com/wprecipes', 3); ?>

Let's have a quick look to the code: First, we're including the rss.php file, which is a part of WordPress core. This file allows us to use the wp_rss() function.
This function takes two parameters: The first is the rss feed url, and the second is the number of rss entries to be displayed.

7 Responses

Jul 27 2011 02:43

Hi, this script doesn’t seem to be working anymore, I got several errors. Any suggestions?

Thanks
Grant

Aug 26 2011 22:35

Hey Grant,
I was looking for something similar.
It might not be working because they deprecated wp_rss. You could try using fetch_feed instead. Check out: http://codex.wordpress.org/Function_Reference/fetch_feed. I’ll try and let you know the results.

Dec 12 2011 19:26

Thanks, it’s working well and fine! Any tweak to open the links in a new window?

Jan 28 2012 01:49

wp_rss () is deprecated !!

Jul 05 2012 16:44

Mine isnt working either. Its so frustrating.

Sep 28 2012 01:12

This
http://codex.wordpress.org/Function_Reference/fetch_feed
worked for me, though I would like to pull a custom field for the feed url…and it doesn’t like my custom field grab
ID, $key, true); ?>
within the parantheses here:
fetch_feed(‘http://example.com/rss/feed/goes/here’)

Any ideas?

Nov 07 2012 18:46

Thanks for the post – I’ve been looking for this type of functionality for quite awhile.

wp_RSS is working for me today. I’m using wp 3.4.2

I’ll dig into fetch_feed, as well. This opens up so much…

A new subscriber,
Newman

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox