People have different needs for different things, and if your need is to display a simple RSS feed in your theme; there is an easy way to do it… without plugins. There are a lot of plugins out there for displaying an RSS feed, but many of them actually over complicate things. Believe it or not, you already have the ability to parse an RSS feed. Until recently, I had been utilizing RSSImport to accomplish my simple feed requirements, but the fewer plugins we run on our sites, the better.
To display a feed on your site, all you have to do is paste the following code in your theme where you would like the feed to be displayed.
[php][/php]Replace the url with the url of the feed you want to parse. Then replace the 20 with the number of titles you wish to show.
You can get a little more complicated if you like and have the ability to add details beyond just the title to your RSS.
[php][/php]Replace the url with the url of the feed you want to parse. Then replace the 20 with the number of titles you wish to show.
You can get a little more complicated if you like and have the ability to add details beyond just the title to your RSS.
[php]- get_item_quantity(10); // How many items you wish to display
$items = $feed->get_items(0, $limit); // 0 is start and limit is noted above
}
if ($limit == 0) echo ‘
‘;
else foreach ($items as $item) : ?>
- [/php]
Note: These functions are not of my own creation, simply things I have found along the way. If you are the author of this function, please let me know so I can properly credit you with your work!
So if I replace the number 20 with zero, will it just show the RSS icon? That’s what I’m attempting to do.
is there a way to add the featured image as a thumbnail on each of the post feeds?
I have not tried, is the image in the rss feed to begin with?