Feedback

Darren Hoyt Dot Com | Design, Development, CSS, CMS, WordPress

Publishing External RSS Headlines to Your Wordpress Site

I wouldn’t advise republishing content from any old RSS feed, but sometimes there’s a reason.

Let’s say in addition to DarrenHoyt.com, I also owned DarrensMusicNews.com, and I wanted to display those headlines in this blog’s sidebar. There are plugins to accomplish this, and sweet RSS/XML parsers like SimplePie, but Wordpress already comes with a function to handle it — this can be seen on your WP dashboard page where headlines are pulled from the Planet Wordpress feed.

That dashboard code lives in /wp-admin/index-extra.php, which is where I took fragments and rewrote it to a simpler snippet:

<?php
require_once (ABSPATH . WPINC . '/rss.php');
// insert the feed URL here
$rss = @fetch_rss('http://www.darrensmusicnews.com/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>


<?php } ?>

Give it a try. The code is mainly valuable for interlinking multiple sites you may own (check out the “Recently on the GigaOM Network” module in the footer of GigaOm.com. That can also be accomplished with the BlogNetworking plugin).

If you do decide to parse/publish someone else’s blog feed, it’s best to get permission first and give proper credit, and don’t just do it for crummy advertising dollars :P

65 Responses {+}

Trackbacks

  1. Seth Holladay » Links » links for 2008-01-31
  2. Looking for Wordpress module / plugin - Affiliate Marketing
  3. WordPress Developer’s Toolbox | Developer's Toolbox | Smashing Magazine
  4. WP开发者资源-2.10: WordPress Feed高级应用 | 帕兰映像
  5. WordPress Developer’s Toolbox | rafdesign
  6. Wordpress Araçları - İngilizce | indirazzi.com BETA
  7. WordPress Developer’s Toolbox - 山歌好比春江水
  8. WordPress 开发者工具箱1 | Ruijin Ubuntu Blog 生活中的每一点点滴滴......
  9. WordPress 开发者工具箱
  10. 逐浪·网络 » Blog Archive » WordPress 开发者工具箱
  11. - WordPress 开发者工具箱(上)【联讯网】
  12. WordPress Developer’s Toolbox | Fusuy.com || Webmaster Accessary Platform
  13. cssframework » WordPress 开发者工具箱【完整版】
  14. 135+ Ultimate Round-Up of Wordpress Tutorials | About Us | instantShift
  15. 250 Wordpress Tutorials
  16. 135+ Ultimate Wordpress Tutorials
  17. RR [dot] net / How to publish RSS feed into your blog site

Leave a Response