Display an RSS Feed in Your Theme Without a Plugin

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 ‘

    The feed is either empty or unavailable.

    ‘;
    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!

About Joe D

I have always had a passion for everything computing. In early 2000, I decided to take my passion to the web. Thus, C.O.D. was born. Through the years we have made many great friends at C.O.D. and hope to continue our journey for years to come.

Check Also

Manage Multiple WordPress Sites with InfiniteWP

Running your website, or websites, on WordPress is an easy choice as the flexibility the …

5 comments

  1. So if I replace the number 20 with zero, will it just show the RSS icon? That’s what I’m attempting to do.

  2. is there a way to add the featured image as a thumbnail on each of the post feeds?

Leave a Reply to Joe DiFiglia Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.