How To Display External RSS Feeds


Sponsored Links




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. If you have little bit knowledge on CSS and XHTML you can make it more fancy layout.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net


16 Responses to How To Display External RSS Feeds

  1. Sharath says:

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

  2. Thanks for the scripts. Now I don’t have to use widgets to display external rss feeds.

  3. Hiren Modi says:

    thanks for this nice tut but i need simple and php code that not use any external include file.

  4. Does anybody know how to add a custom field to the section where the url is at. I want to be able to add diffrent urls to each single page through custom fields. Thanks

  5. tipu says:

    can you tell me how to add rss feed in to wordpress page?

  6. wow, works perfectly. Thank you so much!

  7. Irwan says:

    Wow! I was looking for this everywhere..
    Thank for the code

  8. Irwan says:

    I was successfully implementing this code but not with the rss feed with images. Any help?

  9. victor says:

    I am interested in showing rss feeds with images too so I second Irwan in asking for help.

  10. Girl xinh says:

    Nice post!
    How to get latest post only(or set the number of posts we want to get)
    Thank you!

  11. Arfa says:

    Hi,

    When I use your code in my blog’s sidebar, it gives me the following error.

    ======================================
    Fatal error: Call to undefined function _deprecated_file() in /Users/admin/Sites/dealmagic/wordpress/wp-includes/rss-functions.php on line 8
    ======================================

    I am using the following RSS feed
    http://www.dealmagic.com/delhi.rss

    Can you please point out what might be wrong.

    Thanks

  12. Thank you for the post. It very useful. I were looking for a solution since hours. Your solution is working for me

  13. Indyaz says:

    Good article .. its help me lots without plugins.. thanks a lots

  14. Trishack says:

    Good article, although i cant get it to work right. This is what im looking for, to add my news rss feeds from another site, its perfect, if i knew how to do it

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>