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.

Would WP_Query('cat=1') display custom post types, or is that something that I have to specify?

I have a custom post type, am assigning it to a category, and would like for it to be displayed when that category is visited, but that doesn't seem to be happening.

Thank you for your help.

share|improve this question

1 Answer 1

You need to do:

WP_Query('cat=1&post_type=any')

Or if you want just your custom post to show, put the name of it instead of any. More info in Codex

share|improve this answer
    
If a custom post is under a category, will it show when that category is viewed? –  mustafa.0x Feb 21 '13 at 16:18
    
you nwill need to add ?post_type=your custom post . Why not using taxonomies? –  chifliiiii Feb 21 '13 at 20:20
    
I don't want to change the theme code; I just want all posts under a category to be displayed. This used to work in previous versions of WordPress. –  mustafa.0x Feb 22 '13 at 5:46

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.