[wp-hackers] Custom Post Types on Front page

Paul paul at codehooligans.com
Wed Jun 9 16:33:44 UTC 2010


Have been working with the new Custom Post Types and Taxonomies to build out a real estate listing system. So far things work great. Serious hat tip to all who worked on this. 

I've noticed on the Settings > Reading page there are still only the options to show latest posts or a page on the front. In my case I want to display my 'property' Custom Type. I've worked around this via code (below). But wondering if there should not be some way to have the custom types selectable on the Settings > Reading panel. I also checked the /wp-admin/options-reading.php code and don't see anything (actions or filters) that can be used to supplement this. Just wondering if this is to be some future enhancement or a don't care issue since there are more important things to tackle. 


add_filter( 'pre_get_posts', 'property_get_posts_filter' );

function property_get_posts_filter( $query ) {

	if ( is_home() )
		$query->set( 'post_type', array( 'property' ) );

	return $query;
}



More information about the wp-hackers mailing list