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.
4 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 !!
Trackbacks: