Connect with us

Tips & Tricks

How to: Display RSS feeds from anywhere

Here is a simple way to display any RSS feed in your WordPress blog.

<?php include_once(ABSPATH . WPINC . '/rss.php');
	$rss = fetch_rss('http://feeds2.feedburner.com/WPCult');
	$items = array_slice($rss->items, 0, 4);

		if (empty($items)) echo '<li>No items</li>';
		else
			foreach ( $items as $item ) : ?>
            <a style="font-size: 14px;" href='<?php echo $item['link']; ?>' title='<?php echo $item['title']; ?>'><?php echo $item['title']; ?></a><br /> 
            <p style="font-size: 10px; color: #aaa;"><?php echo date('F, j Y',strtotime($item['pubdate'])); ?></p>
            <p><?php echo substr($item['summary'],0,strpos($item['summary'], "This is a post from")); ?></p>
            <?php endforeach; ?>

The first step is to include the WordPress file rss.php then will apply code after to style the feeds.

Of coarse I forgot to mention, change the RSS feed to the feed you want to pull.

5 Comments

5 Comments

You must be logged in to post a comment Login

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Marie Osmond Net Worth: 5 Interesting Facts You Should Know

Marie Osmond Net Worth: 5 Interesting Facts You Should Know

Marie Osmond is an American actress, singer, and designer. She gained international recognition in the 1970s after her success in country music. Marie is also known for hosting the television variety show “Donny & Marie” with her brother Donny Osmond. Here are five interesting facts about Marie Osmond 1. Marie Osmond net worth is estimated […]

Blueface Net Worth: 5 Interesting Facts About the Rapper

Blueface Net Worth: 5 Interesting Facts About the Rapper

Blueface Bleedem, or simply Blueface, is an American rapper from Los Angeles currently signed to Birdman’s Cash Money West label. He rose to fame after releasing single ‘Deadlocs’ on music platform SoundCloud. The song has received more than 2.5 million streams. Here are some of the interesting facts about Blueface. 1. Blueface net worth is […]

FaZe Tfue Net Worth: 5 Interesting Facts You Should Know

FaZe Tfue Net Worth: 5 Interesting Facts You Should Know

Turner Tenney, professionally known as FaZe Tfue or Tfue is an American gamer, Twitch streamer and a member of FaZe Clan. Some people considered him the better player than Ninja and also ‘The Best Player in the World’. Here are some of the interesting facts about Faze Tfue including his path to success, net worth, […]