Revisiting parsing a feed

A while back we had a guest post from WordPress Modder on how to parse (display) a feed anywhere in a template. Since then, WP & WPMU 2.7 have rolled in a new function to handle this with a lot less code.

Just put the following anywhere in the template:
<?php include_once(ABSPATH . WPINC . '/rss.php');
wp_rss('http://example.com/rss/feed/goes/here', 5); ?>

Replace the example URL with the URL of the feed, and the 5 with how many titles you want to show.

Or, if you want to get really fancy, you could adapt my Build a Widget, toss this code in there with your sitewide feed and let any user display the latest sitewide posts (from the sitewide feed) in their sidebar.

(Yes, you can use the RSS widget to do the same thing, but most users don’t know how to use it. )

HT: WP hacks

[Post to Twitter] Tweet This Post 



Random Posts

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top  banner ad


Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image