RSS is the way to display recent articles published in any blog or website. People tend to subscribe with these feed to get in touch with the recently published articles of their choice. If you own more than one blog and want to display RSS feed of any of your blog on a particular webstie, you can easily do that. Following is the code to do that.

<?php include_once(ABSPATH . WPINC . ‘/rss.php’);
wp_rss(‘http://finance.blogorganization.com/feed’, 5); ?>

Above code has three componenents

  1. First is  “rss.php” file. It  is a part of WordPress core. This file allow us to use the wp_rss() function.
  2. rss feed url: Give the url of blog for which you want to display feed. In above example required url is http://finance.blogorganization.com/feed
  3. Number of rss entries:  In above example 5 is set. So only 5 recent articles will be shown.

You can place above code anywhere you want. You can add it to index.php file or display it in siderbar etc.

Source: Article first published in Blogger’s Magazine.

FacebookTwitterMore...