December 25th, 2009 By WP Tricks Posted in Tricks

How To Display External RSS Feeds

On our recent post, we have write about WordPress Feed Tricks, Right now we will do something else. Sometime we have another useful resource about our blog, some of them really interesting and we need to put the content on Sidebar. With little bit code and tweak, we can made it on our WordPress. How To Display External RSS Feeds on our WordPress is easy.

There are so many method to display External Feeds, we can using RSS Widget, or write our own code. On this tips, we use some WordPress functions and make it smoothly on our WordPress

The first time is open sidebar.php (if you want display external RSS content on your sidebar) and write this code below

<?php
require_once (ABSPATH . WPINC . '/rss-functions.php');
// here's where to insert the feed address
$rss = @fetch_rss('http://feeds2.feedburner.com/WPGPL');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<?php
// here's (5) where to set the number of headlines
$rss->items = array_slice($rss->items, 0, 30);
foreach ($rss->items as $item ) {
?>
          <li> <a href='<?php echo wp_filter_kses($item['link']); ?>'> <?php echo wp_specialchars($item['title']); ?></a> <span class="sdate"><?php echo wp_specialchars($item['description']); ?></span> </li>
          <?php } ?>

<?php } ?>

Please note, you need replace RSS feed source with your own resource and save than check on your own blogs. In our example, you can check on our sidebar, don’t forget to subscribe our post

  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Design Float
  • DZone
  • Live
  • Posterous
  • Reddit
  • StumbleUpon
  • Yahoo! Bookmarks
  • PDF
  • email
  • Print

Amazing Touch


2 Comments

  1. Hey, thanks for this. I was searching for this particular thing. I wanted to display news feeds on my blog. Thanks once again.

    • admin

      You are welcome Sharath



Add Your Comment