Return to Snippet

Revision: 49917
at August 2, 2011 07:21 by cpres


Initial Code
add_filter( 'pre_get_posts', 'my_get_posts' );

function my_get_posts( $query ) {

	if ( is_home() && false == $query->query_vars['suppress_filters'] )
		$query->set( 'post_type', array( 'post', 'page, 'albums' ) );

	return $query;
}

Initial URL

                                

Initial Description
add this to functions.php and you won't have to mess with the index page.

Initial Title
Wordpress - Multiple Post Types in Loop

Initial Tags
post, wordpress

Initial Language
PHP