External Rss feeds in WordPress

What is Rss?

When working with blogs, one will naturally encounter the concept of RSS feed. Perhaps you have also fallen over it on your way, but you may be wondering what it is and how it is used! Fortunately, it is not very difficult even when you just got it explained.

An RSS feed contains data from your website stored in a format called XML. Typically, it will be data like your 10 most recent blog posts, and from other sites – which are not blogs – it could be the page’s latest news. The advantage of an RSS feed is that it is easy for other websites to retrieve the information from your website and display them on their own website or simply link to your content

How to use your RSS feed

Your RSS feed is thus an easy way to get your content forwarded to other websites. For example, several websites offer to link to your RSS feed or otherwise retrieve your content from your RSS feed. You can also link to your RSS and let your users track your latest posts via their feed reads such as Google Reader. In this way, your readers can be notified of your new posts without having to visit your site. Smart!

How to make an RSS feed

If you use WordPress, it’s very easy! Because then your RSS feed is already made and can typically be accessed at the address “https://yourdomain.com/feed”. So this is the address you need to link if you want people to save your RSS feed.

Found this little snippet to display external RSS feeds on its pages in list form without thumbnails.

I was supposed to use such a function myself and thought that I would just share this little gem with whoever is looking for a similar opportunity.

Insert the snippet below into your Function file in your theme.

//This file is needed to be able to use the wp_rss() function.
include_once(ABSPATH.WPINC.'/rss.php'); function readRss($atts) { extract(shortcode_atts(array( "feed" => 'http://', "num" => '1', ), $atts)); return wp_rss($feed, $num); } add_shortcode('rss', 'readRss');

Then you just add this shortcode to your pages or posts.

[* rss feed="https://spliid.nu/feed" num="5" *] <-- (Uden de 2 *)

And correct it to suit your WordPress theme and posts

Leave a Reply