Convert any RSS to HTML

RSS feeds are a great way of not only promoting your own online content, but also of leveraging that of other independent publishers for syndication purposes. Sooner or later you are going to want to make the news from your RSS feeds accessible to a broader audience, whether you want to aggregate and filter the latest news in your particular tightly-focused niche, or bring fresh traffic to your website by allowing others to do the same. RSS To HTML services allow you to easily publish these news feeds directly to your web site, just like any other content. Adding this to your wordpress theme will convert any RSS feed into HTML to display in your wordpress theme.

 

 

 

<?php
include_once(ABSPATH.WPINC.'/feed.php');
$rss = fetch_feed('http://feeds.feedburner.com/wpsnipp');
$maxitems = $rss->get_item_quantity(5);
$rss_items = $rss->get_items(0, $maxitems);
?>
<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
// Loop through each feed item and display each item as a hyperlink.
foreach ( $rss_items as $item ) : ?>
<li>
<a href='<?php echo $item->get_permalink(); ?>' title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'><?php echo $item->get_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>

Leave a comment