Display other site rss feed to your site in wordpress

Topics focus on Web Developments, Programming, Database, Digital Marketing Tutorials, Code Snippets, SEO, Social Media Marketing and Inspirational articles.

Display other site rss feed to your site in wordpress

Display other site rss feed to your site in wordpress

Here, I am displaying you that how to display other site RSS feed to your site in wordpress. One of my reader want this. So I have write this article for him. You can display post links, titles, dates etc. through rss feed. Below is the code which you have to put on your theme where you want to display.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php 
include_once(ABSPATH.WPINC.'/feed.php');
 
$rss = fetch_feed('http://feeds.feedburner.com/websitename'); //Paste website rss feed url
$maxitems = $rss->get_item_quantity(10);
$rss_items = $rss->get_items(0, $maxitems);
 
?>
	<ul>
	<?php 
		if ($maxitems == 0):
			echo '<li>No items.</li>';
		else:
			foreach ( $rss_items as $item ) : 
	?>
				<li><a href='<?php echo $item->get_permalink(); ?>' title='<?php echo $item->get_title(); ?>'><?php echo $item->get_title(); ?></a> <br/>Posted On: <?php echo $item->get_date('j F Y | g:i a'); ?></li>
			<?php endforeach; ?>
	<?php 
		endif; 
	?>
	</ul>

Add comment


 

Pin It on Pinterest

Share This