


wp-content/themes/child/rss-feedname.php.The get_template_part function has two arguments, slug and name, that will look for a template file with the name in the following format, starting with the file at the top (if it doesn’t find the first, it will move on to the second, and so on): By using get_template_part, we can keep the functionality separate to the layout. The code above is using the get_template_part function to link to a separate template file, however you can also place the RSS code directly into the function. Once you have initialized the feed, you’ll need to create the callback function to produce the required feed, using the following code in your theme’s functions.php file or in a site specific plugin: Make a note of the feedname, as you’ll need this later on. The feedname will make up your new feed url /feed/feedname and the callback function will be called to actually create the feed. The add_feed function has two arguments, feedname, and a callback function. The above code triggers the customRSS function, which adds the feed. Let’s assume you want to create a new RSS feed which displays just the following information:įirst thing you need to do is create the new RSS feed in your theme’s functions.php file or in a site-specific plugin: Having said that, let’s get started with your first custom RSS feed in WordPress. If you are a beginner, and still want to try it, then please do so on a local install.Īs always, you must create a complete backup of your WordPress website before making any major changes to a live website. Please note that this tutorial is not intended for beginner level WordPress users. In this article, we will show you how to create custom RSS feeds in WordPress. The default RSS and Atom feeds are enough for most users, but you may wish to create a custom RSS feed for delivering specific type of content. You can tweak the default feeds by adding custom content to your RSS Feeds, or even adding post thumbnail to your RSS Feeds. WordPress comes with built-in default RSS feeds.
