I found the answer CSS Tricks and it works.
Here’s the code I use.
$terms = get_the_terms( $post->ID , 'portfolio_user' );
foreach ( $terms as $term ) {
echo $term->slug;
}
Related Posts:
- wp_list_categories: order by term order?
- Difference between get_category, get_term_by and get_categories
- get_terms from registered taxonomies not working
- Group child category IDs based on their parent category
- Getting all categories even with no products under it?
- Add HTML to Term Description
- How to create a array that contains all of the children slugs of a specific parent category
- List posts by their custom taxonomy term, with a condition
- I can get posts in all categories. But I want to get the custom post type I created
- how to show all categories by get_terms
- Is there any WordPress way to get all categories for some selected posts?
- Is There a Difference Between Taxonomies and Categories?
- What is ‘term_group’ for ‘order_by’ in get_terms()?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Order get_terms by term meta
- Display all the subcategories from a specific category?
- Get parent id by term id
- How to get_term_children output in alphabetical order?
- When to / not to use wp_get_post_terms vs get_the_terms?
- get_terms vs. get_categories: does it matter?
- Woocommerce get category image full size
- Order get_terms() By Custom Field
- Control term order on a per-post basis
- MySQL Query to Retrieve Category from wp_posts
- Fixing category count
- Why does WordPress combine a term with the same name in the wp_terms table?
- How can I get category ID by category name?
- Correct use of get_the_terms()
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Get multiple term IDs by slug, and then exclude them in get_terms
- get_terms name__like list categories according to letter
- Child terms from multiple parents?
- Elegant way to add parent categories?
- How can I select a primary category?
- I have a term_taxonomy_id — is there an API call to get the taxonomy?
- Exclude Child Terms From Parent Posts
- same taxonomy for several post types: how to hide empty in a specific post type?
- How to sort terms with diacritical signs?
- wp_set_object_terms creates relationship to REVISION?
- get_terms(); show private posts when logged in
- Get category ID after wp_insert_term
- Programmatically create product category and add thumbnail in woocommerce
- How to order the get_categories result
- How do I access a single term from a post?
- Prevent Selected Terms Rising to the Top
- Send an email when custom post type category is changed
- How to order get_term_children output by alphabetic order
- How to Make a Category Always Selected?
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Excluding posts from a category but only if they’re not in multiple categories
- Glossary with Custom Post Type
- How to update incorrect post count in taxonomy?
- Term begins with a letter
- get_post_terms not working as expected
- Update term count using a callback function
- Get terms that are associated with products from current category
- wp_update_term not creating new unique slug
- List all categories but exclude current post category on single post page
- Display Categories Assigned to a WooCommerce Product
- has_term() does not return when term is assigned post?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Getting the sub category
- get_terms() but with additional dimensions?
- Use get_term_children to get the sub category of a parent category for the current post
- Count argument in get_terms has no effect on ouput/doesn’t work
- Action hooks returning old category instead of new category
- Update wordpress post terms programatically
- Wp set post terms not work
- how is it possible that using wp_insert_category throw a fatal error?
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- Display empty taxonomy terms with get_terms()
- List all custom post type posts from a given category?
- get_terms only show term if there is a post using it
- Get a list of Terms for a specific category
- Get post terms for multiple posts at once?
- wp_update_term: How could i update the “name”?
- Get the Term List – Ordering
- get_terms won’t display product_cat or any other custom taxonomies when specified
- get / list categories and counts filtered by custom taxonomy term
- Reduce / optimize calling of wp_get_object_terms() when generating permalinks
- Check if an array of posts has posts from a specific category
- Problems with function on function.php
- How to get category image custom post type taxonomy in wordpress?
- Get only one product category woocommerce
- When to use ‘get_category_by_path’ vs. ‘get_term_by’ to get category object from `get_query_var( ‘category_name’ )`?
- Category page only displaying the posts from a custom type
- How to trace/fix false $term->count, rogue term relationships?
- How to order and count get_terms by specific post type?
- Get those terms with a specific meta key value
- get_terms() order by term_meta
- Limit Words in Category / Term Description – Admin Panel
- get_terms() for custom taxonomy related to another taxonomy
- List Terms in Category
- How do I get a list of all categories that a given user has written blog posts for?
- What is the term shortlink structure?
- get_term_by “name” not working with & in name
- I want to loop through Woocommerce Product Catogories and show them in dropdown