This piece of code will return all categories assigned to current product.
global $post;
$terms = get_the_terms( $post->ID, 'product_cat' );
foreach ($terms as $term) {
$cat_name .= $term->name.', ';
break;
}
echo $cat_name;
add this code inside
single-product.php
Hope this help !
Related Posts:
- Custom Taxonomy as checkbox or dropdown
- Taxonomy: Why ‘with_front’ => false DOES NOT WORK?
- Custom Taxonomy as Dropdown in admin
- How to completely disable a taxonomy archive on the frontend?
- How to list all categories and tags in a page?
- Retrieve single term slug
- How to show term-specific post list, without posts associated with child terms?
- Query multiple taxonomy in Custom Post Type
- Custom Post Type: How to display all of same taxonomy?
- Remove “-2” from a Toolset Types URL with the same post name
- Custom post type taxonomy template
- Associate Taxonomies Across Post Types
- Use the_taxonomies() to create a simple list
- Listing taxonomies from custom post type
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Taxonomy Templates
- Custom Post Type and Taxonomy combination
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Relationship between two taxonomies and a custom post type [closed]
- How to check the terms in single custom post type template
- How can I move a custom taxonomy and its data from one post type to another?
- Custom Taxonomies not appearing in Admin
- Custom Post Type Taxonomy Filters
- How to display custom taxonomies with links in filter menu?
- How to Filter custom post type by taxonomy?
- Get related posts of child term of custom post type
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- list taxonomies from a custom post type
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- Taxonomies relations
- Is it better to use WordPress Custom Post Types or Taxonomies?
- Full Custom Post Type List Organised by two Taxonomies
- WordPress Doesn’t Generate Taxonomy Archive
- Custom post with more than one custom taxonomy
- Get the taxonomy of a post hierarchically
- Adding custom taxonomy in same menu place with two custom post types
- How to get list of taxonomy slugs ordered parents>childs?
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Rename a slug label
- Hide meta box for everything BUT a certain custom post type
- How can I create an automatic drop down menu with my tags?
- How to define a term for custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- 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?
- WordPress multisite – is it possible to have different taxonomies for each site?
- Query custom post types & Taxonomies and list them in a table on a page
- Taxonomy template page not working
- Creating custom post type posts and associating them with a post from another custom post type
- Group Custom post type in a taxonomy page by its child taxomony
- Getting List of child terms from custom taxonomy parent
- Get posts by category name
- Custom taxonomy query showing more than 4 posts
- Custom Post taxonomy template
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- How to get post count of specific taxonomy that have store name & category
- Duplicate slug/permalink issue while adding same post name
- Filter taxonomy by CPT
- 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
- Change custom post taxonomy values from front-end
- Display 3 level taxonomies
- Get all posts for custom taxonomy term
- List posts that have the current url taxonomy
- How to transfer categories (default) to custom taxonomy?
- Custom Taxonomy – fields
- Pages of my taxonomy terms are showing all posts
- tax_query not working?
- If custom taxonomy exist on post?
- How to get all posts assigned to a taxonomy term only?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Display all posts from single taxonomy term
- Connect 8 Taxonomies to One (Main) taxonomy. How to?
- Filter By Term Not Working – Custom Post Type
- How to show post which has the specific taxonomy terms?
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Custom post type taxonomy template and URL confusion
- WordPress add taxonomies/terms list as a menu in archive page
- Custom Taxonomy is disabled on Edit page
- Override “Parent” input for custom taxonomy
- Custom post type post taxonomies
- insert a taxonomy for a custom post type
- Check if taxonomy is attached to at least one post in a post-type
- Custom posts and custom taxonomies for many products and categories?
- List custom taxonomy terms
- How do i get the taxonomy term name on the CPT archive page?
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy listing issue – does not display how I would like
- Show custom category archive as front page and remove taxonomy slug from urls
- Is it possible for post and custom post type to share a category base slug?
- Taxonomy Archive URL + Template
- Custom Taxonomy archive with url parameters