Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

in my custom post type i've set 'taxonomies' => array('category'). However, within my category.php page, none of the custom post types are being displayed, only posts.

How do i make ALL post types appear, not just the post?

share|improve this question
    
possible duplicate of Custom Post Types on Category Pages –  Chip Bennett Sep 16 '11 at 12:40
add comment

1 Answer

just guessing.. did you set "public"=>"true" in register_post_type(..)

share|improve this answer
    
Yep, public is set to true. According to print_r($wp_query), it tells me that it's only querying the posts table. I solved this by putting this at the top of my loop $cats = new WP_Query(array('post_type'=>'any','category_name'=>single_cat_title('', false))); –  dotty Sep 16 '11 at 13:10
    
don't forget about paging in wp_query –  Maciej Kuś Sep 16 '11 at 13:13
1  
here is better solution using pre_get_posts filter: wordpress.stackexchange.com/questions/18497/… - read all comments and change is_home() to is_category() in this custom filter function –  Maciej Kuś Sep 16 '11 at 13:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.