I'm sure there's some very easy explaination for this, but I'm stuck. I am just trying to put a nice, simple recent posts element on the front-page of a site and for some reason when I try to use:
$args = array(
'post_type' => array('post','recipes'),
'posts_per_page' => 4
);
query_posts( $args );
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
...
endwhile;
wp_reset_postdata();
it won't show the recipes. The strange thing is that if I call 'post' and 'page' it'll display both, but as soon as I add 'recipes' it just displays the first type requested that's not recipes. Am I missing something easy here?
Edit:
Updated with WP_Query instance instead of query_posts, still doesn't work.
$argz= array(
'post_type' => array('post','recipes'),
'posts_per_page' => 4
);
$my_query = new WP_Query($argz);
Still doesn't work. Still returns the correct query var and everything, but doesn't display both post types.
posts_per_page
is supposed to take an integer not a string. Drop the quotes and try it again.posts_per_page
element. As for custom post name - if I take thepost
post type out of this statement it returns the 4 most recent recipes. This is the main loop for this page.