can I use a category as common for more than one custom post types? In this case same category will have more than one type of posts..
Leave a Reply
You must be logged in to post a comment.
can I use a category as common for more than one custom post types? In this case same category will have more than one type of posts..
You must be logged in to post a comment.
When you use
register_taxonomy()
, the second argument is theobject_type
argument, which accepts either a string or an array. You can pass this an array of objects to apply the taxonomy to, and it will be common between those. So, for example:array( 'cpt_slug', 'post' )
would give you a common taxonomy betweencpt_slug
andpost
.If you want to add the existing taxonomies to a new post type, you can use
register_taxonomy_for_object_type()