Ameisenman
Member
Posted 2 years ago #
Hi,
I searched the web and didn't found an answer to my question: I created some custom post types with the register_post_type function and gave them the taxonomies 'category' and 'post_tag'. All goes well but when I try to open a category which holds the custom post type pages there is no post, nothing.
How can get it to work? I mean, how to display those custom post type posts on the category/archive pages?
Thanx
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array(
'post_type' => 've_products', // custom post type
'paged'=>$paged,
));
?>
you have to query the custom post type, this is mine to display ve_products
you will need to array your custom post type with post if you want bot normal posts and custom post types to display
'post_type' => array('post', 've_products'),
Ameisenman
Member
Posted 2 years ago #
Thanx a lot! In conjunction with the ability of WordPress to give categories a different template (e.g. category-products.php), I managed it!!! Great!