php - Wordpress get custom post type posts by category -


hi have problem custom post type categories, try post have category output post. can 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 give posts. don't understand why

the arguments key should 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); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -