enter image description here

Two different post types have different category types. Is it possible if two different posts types have same category types?

Further Explanation: A particular category should be available across every post type, and there shouldbe no need to create it again individually for every post-type.

  • Depends how the Celebrity post is coded. I would go with the default posts and add the 'Celebrity' as a tag – Lucky Chingi Feb 16 '18 at 14:35
  • You are trying to change the utility of the post by assuming so much. For now, the constraint is that we have to create custom post types. Lets remain within the question. do not try to change the question dimension. – The WP Intermediate Feb 16 '18 at 14:41

What you want is the normal behaviour if you register a taxonomy to multiple post types. What you appear to have done here is register a new Category taxonomy for your Celebrity post type.

To add the default Category taxonomy to a post type use register_taxonomy_for_object_type().

register_taxonomy_for_object_type( 'category', 'celebrity' );
| improve this answer | |
  • will this create any sort of conflict? – The WP Intermediate Feb 16 '18 at 14:42
  • 1
    Like what? Both post types will probably show up if you browse the category, but that's presumably the reason you want to do this. – Jacob Peattie Feb 16 '18 at 14:45
  • but that's presumably the reason you want to do this. → Yes, that's true. – The WP Intermediate Feb 16 '18 at 14:45
  • 1
    What's the reason it needs to be a different post type? If it's just template related then since 4.7 you can create additional templates for all post types, not just Pages: developer.wordpress.org/themes/template-files-section/… – Jacob Peattie Feb 16 '18 at 14:47
  • 1
    The reason for separate post types is a better management of data. Politicians bio should remain separate from journalist, and celebrity or singers, and vice-versa. It is a better management of posts assuming that site will grow huge 5-7 years later. Planning is to create 6-8 such custom post types. – The WP Intermediate Feb 16 '18 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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