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:
- How to get all taxonomies of a post type?
- How do I append multiple taxonomies to the URL?
- Custom taxonomy not showing up when adding a new custom post type
- How do I list custom taxonomy terms without the links?
- How to list custom taxonomy categories?
- Custom Taxonomy Template Post List with Sort Order
- wp_insert_term doesn’t work with custom post type’s taxonomy
- How to list all categories and tags in a page?
- Create an archive page for custom taxonomies
- Get the ‘slug’ of a custom taxonomy
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- How to get the parent’s taxonomy?
- Include custom post type in “all posts”
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- wp_insert_post custom taxonomy
- Taxonomy-{taxnonomy}.php is not working
- Display taxonomy term only if there’s a value
- Get list of terms of current taxonomy archive for another taxonomy
- Get all taxonomies for all post types
- Associate Taxonomies Across Post Types
- Show Post Count of a Category
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Relationship between two taxonomies and a custom post type [closed]
- Menu Multiple Taxonomies
- How to make a custom taxonomy selectable in post publish area?
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- Fetch taxonomies by custom post type id array
- get_terms showing all categories instead of the ones assigned to a specific post
- Custom page template for category taxonomy
- How do I get array of types associated with a taxonomy?
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Display all posts in main category and 1 subcategory
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Custom Taxonomy back-end customizations
- How to Filter custom post type by taxonomy?
- Is it possible to have dedicated page for parent/child taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Display a grid of taxonomy terms at root taxonomy page
- limit value taxonomy based on previous taxonomy value wordpress
- How do I display the grand child items of a taxonomy term?
- Is it better to use WordPress Custom Post Types or Taxonomies?
- How to make custom taxonomy into drop down select in a custom metabox
- How do I share categories across multiple post types?
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- How to Set Taxonomy Object Description?
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- Variable not working in WP_Query
- Hide meta box for everything BUT a certain custom post type
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- Alphabetically sort a taxonomy.php template by post title
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Show Taxonomies with admin area for custom post type?
- Use the custom post type archive for taxonomies?
- Taxonomy template page not working
- Changing CPT slug and taxonomy already registered in parent theme
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Custom Taxonomy Terms in Menu lead to which page?
- Get posts by category name
- Query Custom Post Type by Taxonomy
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- How to order taxonomy terms by most recent post?
- Custom taxonomy returns 404 even with saving permalinks
- Create custom post type categories
- How to add CSS class field in Custom Taxonomy?
- Taxonomies are not showing in the category dropdown
- Change custom post taxonomy values from front-end
- Set a Default CPT taxonomy by taxonomy id
- List all posts associated under custom taxonomy
- How to transfer categories (default) to custom taxonomy?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- How to manage a dynamic multi-level page hierearchy system?
- Categories manage
- Add other all taxonomies as meta boxes to custom post type
- How to get post type archive category title
- Pages of my taxonomy terms are showing all posts
- Custom post type category link + add to menu
- Single taxonomy for different custom post types
- Changing an item in drop down after 5 latest posts per taxonomy
- Filter Term By Parent Term – Custom Post Type
- How to show post which has the specific taxonomy terms?
- Best approach to allow front-end display of posts’ reviewers?
- WordPress add taxonomies/terms list as a menu in archive page
- Custom Post Type and Taxonomies, creating the corresponding template file and loop the data
- How to create TEMPLATES for TAXONOMIES? What I have to change in this code?
- List all posts from custom post type by taxonomy
- Displaying taxonomy icon outside archive page
- Archive templates based on taxonomies
- Show taxonomies from specific CPT
- insert a taxonomy for a custom post type
- See the process of creating a taxonomy and tell me where I made a mistake
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Show custom category archive as front page and remove taxonomy slug from urls