Wordpress built in RSS parser
A nice wordpress tip. IF you want to add RSS you can do so by just using the built in rss parser.
See the code below. Just add your rss url in the wp_rss function your done.
However this is outdated! See below for a better way to do this.
Old Way: (This may cause invalid characters when using UTF 8 encoding.)
[sourcecode language='php']
wp_rss('http://rss-feed-url', 10); ?>
[/sourcecode]
And Now for a better Way:
[sourcecode language='php']
include_once(ABSPATH . WPINC . '/feed.php');
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed('http://example.com/rss/feed/goes/here');
// Figure out how many total items there are, but limit it to 5.
$maxitems = $rss->get_item_quantity(5);
// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems);
?>
-
No items.
-
get_date(‘j F Y | g:i a’); ?>’>
get_title(); ?>
‘;
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
[/sourcecode]

test comment
Like or Dislike:
0
0