You can share a taxonomy between multiple custom post types.
You will need to register the taxonomy in your plugin file or theme’s functions.php file:
<?php register_taxonomy( $taxonomy, $object_type, $args ); ?>
WP Codex: Registering Taxonomies
When you register your taxonomy you will need to use an array for the $object_type. In this example the taxonomy “city” is being assigned to the “people” and “cars” post types:
register_taxonomy(
'city',
array( 'people','cars' ),
array( 'hierarchical' => true,
'label' => __('City'),
'query_var' => 'city',
'rewrite' => array( 'slug' => 'city' )
)
Related Posts:
- Theme localization of “slugs” (custom post types, taxonomies)
- Custom Post type & Taxonomy URL structure
- Combining Multiple Taxonomies in one URL
- Taxonomy archive with same slug as custom post type?
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Remove taxonomy slug when not assigning taxonomy with custom post types
- Rewrite CPT slug with two taxonomy slug instead of one
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Taxonomy breaking pages permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Custom post type and taxonomy slug issue
- Does WordPress limit the length of slug names for Post Meta or Terms?
- How can I make the slug of the taxonomy also the slug of the custom post
- Allow duplicate slugs for custom post type with taxonomies
- Nested Custom Post Type or Custom Post Type Parents?
- Including taxonomy term before post type breaks top level pages
- Rename a slug label
- How to add current custom taxonomy slug to body class
- Using page slug in wp_query
- Listing all slugs?
- Custom Post Type Advanced Slug
- Changing CPT slug and taxonomy already registered in parent theme
- How do I set a post slug automatically based on taxonomy?
- Custom post type and multi taxonomies + customize url
- Use custom post type taxonomy between cpt slug and name
- Remove custom taxonamy slug with pagination
- How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom post type post_type_link gives “page not found” on any other custom post type
- Custom taxonomy archive slug overwrites static page
- Slugs on hierarchical taxonomies
- Display a Custom Post Type within another with hierarchically slug
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Costum post type with costum (sub)taxonomy
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- WP Query Post Type with same Taxonomy name
- WP Query WordPress Post Type with the same Taxonomy name
- Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
- Hide custom post type slug url from search engine [closed]
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Is it possible to use a post name in a custom post slug?
- Taxonomy Archive URL + Template
- How to Make a Separate RSS Feed for Each Custom Post Type
- custom post type taxonomies UI radiobuttons not checkboxes
- Custom Post Type Archive Template
- Order posts by (hierarchical custom) taxonomy terms and term children
- Filter get_categories() for taxonomy term in WordPress
- Custom search for custom post type, custom meta and search fields
- Custom Permalink for Taxonimie and Custom Post Type
- Adding the taxonomy before the custom post type
- Conditionally custom post type url rewrite
- How do I create filters for custom post types?
- Root slug of taxonomy returning 404
- Pagination for Custom Taxonomy Page [duplicate]
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Hide post navigation if current post is in a category with only one post
- I want to change the word “Tags” in WordPress to something else, but how?
- Set post terms for multiple posts
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Custom Post Type with Custom Taxonomy as Category
- WP_Query() with custom post type and taxonomy — get all terms?
- Get custom post type categories to show up in menus
- Custom Type add Transitions
- How do I get the custom category URL from the custom post type?
- Custom post type name and assigning custom taxonomy
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- Building a Portfolio and need some direction
- Custom Post Type Custom Archive Page Not Working
- Enabling permalinks disables custom page template
- WordPress custom taxonomy page
- Related “custom post type” using “custom taxonomy”
- How to create Custom Taxonomy Search Drop Down for specific Post Type
- Can I set the post_type query_var as a link is clicked?
- How do I disable the built-in editor and automatically configure the properties of new pages?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- Set priority to permalinks
- How to list posts by terms
- Changing CPT permalink
- Custom post type structure + permalink structure
- Custom post type and taxonomy same slug
- Single taxonomy for different custom post types
- Decrement term in for each
- WordPress custom post type advise
- Custom Post Type and Taxonomies, creating the corresponding template file and loop the data
- Generating List of Tags from Custom Post Type
- Post data in separate divs with incrementing class using WP_Query
- Get term_id for each instance of custom taxonomy
- How to list groupings and keep pagination
- Custom Post Types and Taxonomies
- install.php Custom Taxonomy Term not being added to custom post
- How to retrieve taxonomy terms of the current custom post?
- WordPress and Unity high scores table
- Custom post type with new taxonomy [duplicate]
- Custom post type / Filter by letter
- Filtering custom post types using category taxonomy
- How to use wp_set_object_terms depending on page ID?