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.

I'd like to be able to have categories of a custom post type, how do you set this up?

update

I want to keep the default categories for regular blog posts, but a separate set of categories just CPT.

share|improve this question
1  
Do you want to use the existing (default) categories, or define a set of categories specific to your CPT? –  anu May 6 '11 at 15:36
    
possible duplicate of Is there a way to use regular categories with custom post types? –  Chris_O May 6 '11 at 15:38
    
It's going to be a duplicate of something...the suspense is finding out what! –  anu May 6 '11 at 15:39
    
I want to keep the default categories for regular blog posts, but a separate set of categories just CPT. –  qodeninja May 6 '11 at 16:07
add comment

migrated from superuser.com May 6 '11 at 15:30

This question came from our site for computer enthusiasts and power users.

3 Answers

up vote 2 down vote accepted

You need to add 'taxonomies' => array('category') in your register_post_type() function.

share|improve this answer
add comment

You have to register a taxonomy using register_taxonomy or register_taxonomy_for_object_type. The you can use wp_insert_term to insert values for that taxonomy.

share|improve this answer
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.