In our recent project for a client, we needed to include few custom post types we built in the main RSS feed of the site. Specific for that project, we built few custom post types - video, pictures and etc - to make it easier for the client to manage their contents.
However, the default RSS feed for WordPress only includes Post post type. Therefore, every time the client publishes something under the custom post types, those posts won’t be included in the main RSS feed. In other words, readers who subscribed to their RSS won’t be notified with new posts published in those custom post types. This is bad.
1 2 3 4 5 6 7 8 |
|
The snippet below will add all post types, including any custom post types to your main RSS feed. Thanks to Yoast for this awesome snippet. You may drop the code in functions.php
of your child theme or even better, functionality plugin. You may find more information about the code from the Core Trac WordPress.
Leave a Comment