Add WordPress custom post type to the main RSS-feed

January 27th, 2013 |

In the example below we add products from a WP e-Commerce store to the main RSS-feed.

function query_rss_with_product($query) {
    if ($query->is_feed) {
        $query->set('post_type', array('post', 'wpsc-product'));
    return $query;
add_filter('pre_get_posts', 'query_rss_with_product');

There are no comments yet

Leave a Reply

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