• function custom_home_posts( $query ) {
    
    	if ( is_home() ) {
    		$query->set( 'post_type', array( 'article', 'project', 'experiment' ) );
    		return $query;
    	}
    }
    add_filter( 'pre_get_posts', 'custom_home_posts' );

    What’s weird is the code works fine when the array is changed to just a string of one of the post types aka articles.

    Anyone having this problem? Please. I need to show my portfolio site tomorrow!

    Thanks for any help.

  • The topic ‘Query set broken in 3.1 upgrade. (Not removing categories)’ is closed to new replies.