You can get the taxonomies that are registered for a post type with get_object_taxonomies()
. If you pass the post object directly, you don’t even need to explicitly name the post type either.
You can then loop through the result of that function to achieve the result you want:
$taxonomies = get_object_taxonomies( $post );
foreach ( $taxonomies as $taxonomy ) {
the_terms( $post->ID, $taxonomy, '<span>', ", ", '</span>' );
}
Related Posts:
- Saving Taxonomy Terms
- Get Posts by Custom Post Type ,Taxonomy, and Term
- How do I append multiple taxonomies to the URL?
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- How to limit the number of terms (terms acts like categories)
- Custom Post Type – Taxonomy Dropdown Menu?
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Taxonomy term in permalink
- Remove quick edit for custom post type
- Count posts that have specific taxonomy term attached
- Taxonomy archives based on Custom Post Type
- Filtering Posts by Multiple Taxonomy Terms such as in an Admin Post Listing?
- Get the ‘slug’ of a custom taxonomy
- How would I leverage custom Taxonomies in this scenario?
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- Group list of posts by taxonomy and allow for pagination
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- create a back-end wordpress content submission using custom post type
- Disable WordPress Recognizing Path as Attachment
- Include custom post type in “all posts”
- Displaying related posts in a custom post type by a custom taxonomy
- Get all taxonomies for all post types
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- How do I display custom post types through a common taxonomy?
- Paginate_links won’t create the right links on a taxonomy filtered custom post type archive
- How to list custom post types?
- How to filter out post type meta?
- Custom Post Types and Categories?
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- Query Multiple Taxominies Across Multiple Post type’s
- Tag page with Custom Post Types not returning any posts
- Update permalinks when new category added to custom post type taxonomy
- Custom Taxonomy back-end customizations
- Taxonomy custom post type URL
- How do I display the taxonomy for a custom post type in an array
- How to conditionally redirect to the post from a taxonomy page?
- Suggested Post and Taxonomy structure
- How do I share categories across multiple post types?
- Multiple tag cloud filtering
- Get url.com/post_type/taxonomy/term work!
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Output terms for custom post types
- Linking from CPT page to taxonomy.php
- Page not found for custom post type UI plugin and taxonomy
- Custom select query for taxonomies that have posts categorized in another taxonomy
- How to assign tag to custom post type in wordpress?
- Filter second dropdown (tax) based on first dropdown (cpt)
- Hide meta box for everything BUT a certain custom post type
- How can I create an automatic drop down menu with my tags?
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- Taxonomy template page not working
- Custom taxonomy template shows 404 Error
- Custom Post Type API doesn’t show taxonomy or category array
- How to constrain the results to a specific post_type on tag archive page?
- Running a custom query inside another cpt single and trying to grab a variable
- Custom Post Type with modified permalink structure results in 404
- Get posts by category name
- Problems making shortcode with custom post types and taxonomy
- Custom Post taxonomy template
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Get post-meta value of all custom-posts – lowest to highest year-count?
- Query all posts under one taxonomy? Why is my code not working?
- How to use taxonomy term as permalink folder
- CPT archive with WP native/core tax/categories
- Order posts by taxonomy terms
- automatically select taxonomy based on post meta
- Display related CPT with custom taxonomy
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- Define multiple prefixes for custom post type
- Taxonomies are not showing in the category dropdown
- Custom post types not showing on the standard WordPress Category page
- Display 3 level taxonomies
- List posts that have the current url taxonomy
- If custom taxonomy exist on post?
- How to get all posts assigned to a taxonomy term only?
- Wrap an X amount of taxonomy posts in a separate Row in WordPress
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- How to show post which has the specific taxonomy terms?
- Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- WordPress add taxonomies/terms list as a menu in archive page
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Custom Search not working
- Custom post type post taxonomies
- Show all post of a taxonomy with one specific term not working
- Using a Taxonomy in Two Spots in a WordPress Post
- insert a taxonomy for a custom post type
- Custom post type URL returns 404 error page
- Problems with custom post type and hierarchical permalinks
- using post_type with meta_query
- Custom Post Type Template based on Taxonomy
- custom post type tags
- Structure of custom post type / taxonomy?
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List