Hi I have some problem with custom post type categories, I try to get all post that have some category but it output all post. Can you help me please. Thank you.
my code
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => "collection-posts",
'category'=> 1,
'posts_per_page' => 12,
'paged' => $paged
);
query_posts($args);
but it give all posts. I don't understand why
The arguments key should be cat
, not category
:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => "collection-posts",
'cat' => 1,
'posts_per_page' => 12,
'paged' => $paged
);
query_posts($args);