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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -