Top Ad unit 728 × 90

How to Display any External RSS Feed on Your Site




Have you seen other bloggers who display their other blog’s feed on their site. You want to do it too for extra promotion and traffic. Well here is the tutorial for you. Simply paste the following code in anywhere in your theme:
There are times when you want to display external RSS feed on your blog. Perhaps a blog feed of your another blog or some other site. Well you do not need a plugin to do this because WordPress have a function built in that will take care of this. In this article we will show you how you can display an external RSS feed on your blog. This way you can even use WordPress as a news aggregator.
Simply paste the following code in any WordPress file that you choose. Preferrably in a custom page that you create.
01<?php include_once(ABSPATH.WPINC.'/feed.php');
02$rss = fetch_feed('http://feeds.feedburner.com/wpbeginner');
03$maxitems $rss->get_item_quantity(5);
04$rss_items $rss->get_items(0, $maxitems);
05?>
06<ul>
07<?php if ($maxitems == 0) echo '<li>No items.</li>';
08else
09// Loop through each feed item and display each item as a hyperlink.
10foreach $rss_items as $item ) : ?>
11<li>
12<a href='<?php echo $item->get_permalink(); ?>'
13title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
14<?php echo $item->get_title(); ?></a>
15</li>
16<?php endforeach; ?>
17</ul>
Make sure you change the feeds url and the quantity and any other setting that you like
How to Display any External RSS Feed on Your Site Reviewed by Unknown on 1:44 AM Rating: 5

No comments:

All Rights Reserved by Boca Raton Real Estate © 2014 - 2015
Powered By Blogger, Designed by Sweetheme

Contact Form

Name

Email *

Message *

Powered by Blogger.