Add custom post types to WordPress RSS


<?php
    /* SHOW CUSTOM POST TYPE in FEED */
    function my_get_posts( $query ) {
        if ( is_feed() )
            //postType_1, postType_2, postType_3 ARE THE CUSTOM POST TYPES CREATED
            $query->set( 'post_type', array( 'postType_1', 'postType_2', 'postType_3' ) );
        return $query;
    }
?>

Latest Comments

Leave a Reply

comment on this article