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?
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
Hi, this script doesn’t seem to be working anymore, I got several errors. Any suggestions?
Thanks
Grant
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.
Thanks, it’s working well and fine! Any tweak to open the links in a new window?
wp_rss () is deprecated !!
Mine isnt working either. Its so frustrating.
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?
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: