Query for multiple post types does not work

I’d like my frontpage to display a list of my lastest blog posts merged with my latest “Products” custom post type posts.

From the documentation i gather this should work:

query_posts( array('post_type' => array('post', 'product') ) );
while (have_posts()) : the_post();
   the_title();
   the_excerpt();
endwhile;

But that turns a weird list, made of pages !

Note that I’ve put it outside the loop.

What am i doing wrong?

2 Answers
2

almost!
when doing it outside of the loop, you have to reset the query as in:

wp_reset_query();

Leave a Comment