How To Display Other Blog’s Feeds to Your WordPress Blog

By Jers in Blogging Tips, Wordpress tips

There are several plug-ins available out there for this functionality, but if you are like me who is a bit lazy :) , here’s a simple way to add other blog’s feeds to your wordpress blog.

How To Display Other Blogs Feeds to Your WordPress Blog

  1. Open the template file you want to put the other blogs’ feeds. For illustration purposes, we will going to edit the sidebar.php. Our goal is to display the latest n posts of our target blog. In my example, we will going to display the latest 3 posts.
  2. To do this, just add the following code anywhere in the sidebar.php where you want to display the feeds, customizing the highlighted text with your own preference :
  3. <h2><?php _e('LifeGuide'); ?></h2>
    <?php // Get RSS Feed(s)
    include_once(ABSPATH . WPINC . '/rss.php');
    $rss = fetch_rss('http://feeds.feedburner.com/EasyLifeGuide');
    $maxitems = 3;
    $items = array_slice($rss->items, 0, $maxitems);
    ?>
    <ul>
    <?php if (empty($items)) echo '<li>No items</li>';
    else
    foreach ( $items as $item ) : ?>
    <li><a href='<?php echo $item['link']; ?>'
    title='<?php echo $item['title']; ?>'>
    <?php echo $item['title']; ?>
    </a></li>
    <?php endforeach; ?>
    </ul>
  4. Apply some CSS customization on the appearance, the above code should look like the image below.

rss.jpg

 

Source(s): WordPress Documentation

2 Responses to How To Display Other Blog’s Feeds to Your WordPress Blog

  1. Pingback: How To Display Other Blog’s Feeds to Your WordPress Blog - PinoyBlogoSphere.com - Pinoy Bloggers Society (PBS)

  2. Pingback: Powerfull Living » Blog Basics For Everyone

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>