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

84 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
  18. 250 Wordpress Tutoriels et liens pour tous | Guppytrucs Freeware
  19. WordPress Developer’s Toolbox | 9Tricks.Com - Tips - Tricks - Tutorials
  20. Mateus Neves, Designer, Wordpress and more » Blog Archive » Publicando conteudo via RSS externo em seu blog
  21.   WordPress Developer’s Toolbox  by Oshoamy
  22. Wordpress tutorials - Gurushala
  23. 135 link cung cấp thủ thuật wordpress hot nhất | Giải Pháp SEO Internet Online Marketing-SEO consultants
  24. 136 Massive Wordpress Tutorial Collection | WebCoreStudio
  25. 135 webs/blog for wordpress tips |
  26. 135 trang web/blog thủ thuật wordpress hay nhất | iTViệt.VN - itviet.vn - Cổng thông tin dành cho giới trẻ Việt Nam
  27. 135 trang web/blog thủ thuật wordpress hay nhất « mockhangnoithat
  28. 135 TRANG WEB/BLOG THỦ THUẬT WORDPRESS HAY NHẤT « Carton Boxes Packing (bao bì Carton)