WordPress.org

Forums

Show custom post types in main feed (1 post)

  1. leemon
    Member
    Posted 2 years ago #

    Hi!

    I was using the following function in my site to show both posts and books (a custom type) in the main feed:

    function my_pre_get_posts($query) {
    	if ( is_feed() )
    		$query->set( 'post_type', array( 'post', 'book' ) );
    	return $query;
    }
    add_filter('pre_get_posts', 'my_pre_get_posts');

    But, since upgrading to 3.5 the feed only shows normal posts. Has anything changed in 3.5? What can I do to show both posts and books in the main feed again?

    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic