Embed RSS Feeds in WordPress
WordPress makes it easy (well, kind of) to embed RSS feeds into your WordPress template, so you can have a feed displayed in your sidebar, footer, or anywhere else you want in your PHP files. To do this, I used a combination of code from Darren Hoyt and Jeriko.
first, from Darren
<?phprequire_once (ABSPATH . WPINC . '/rss.php');$rss = @fetch_rss('RSS FEED HERE');if ( isset($rss->items) && 0 != count($rss->items) ) {?><ul><?php$rss->items = array_slice($rss->items, 0, NUMBER OF ITEMS);foreach ($rss->items as $item ) {?><li>
and then the bit from Jeriko
<a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?>
</a></li><?php } ?></ul><?php } ?>
Related posts:
Enjoy the post? Encourage me by subscribing to the feed, following me on Twitter, and becoming a fan on Facebook. Cheers!










Hey! My name is Ryan, and I'm a 19 year old in Columbia, SC. This blog is my passion - my hobby, my stress reliever, and my frustration. Hope you enjoy!
