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?
- Woocommerce get category image full size
- Control term order on a per-post basis
- Why does WordPress combine a term with the same name in the wp_terms table?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Elegant way to add parent categories?
- 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?
- get_terms(); show private posts when logged in
- Get category ID after wp_insert_term
- Send an email when custom post type category is changed
- How to order get_term_children output by alphabetic order
- get_post_terms not working as expected
- wp_update_term not creating new unique slug
- Display Categories Assigned to a WooCommerce Product
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Action hooks returning old category instead of new category
- Wp set post terms not work
- Display empty taxonomy terms with get_terms()
- Get the Term List – Ordering
- Reduce / optimize calling of wp_get_object_terms() when generating permalinks
- Problems with function on function.php
- How to order and count get_terms by specific post type?
- Get those terms with a specific meta key value
- get_term_by “name” not working with & in name
- I want to loop through Woocommerce Product Catogories and show them in dropdown
- setting taxonomy term to bulk posts using ids
- display taxonomy slug from term ID
- Custom Post Type Archive Page Filtering
- Does get_terms() use any sort of caching on its query?
- 404 on term taxonomy archive pagination only with some terms
- How can i insert term in a specific language of Polylang?
- Clone Terms of one taxonomy to another
- Categories order with get_terms_args not working in 4.7
- Is There a Difference Between Taxonomies and Categories?
- import_id parameter for wp_insert_term to create custom ID for category
- Getting category URL with hyphens, not spaces
- How to get a post’s associated taxonomies and terms in wp api v2
- get_terms function not returning anything
- Remove a category from a post when saving a new post
- Get parent category id from child category page for custom taxonomy
- get_the_terms() not returning expected result
- Get the ID of category page with or without any posts
- single_term_title() running before get_the_title() [closed]
- How do I print a term list but alter the link text?
- How to get the $meta_type given the $object_id
- How to Link to Most Recent Custom Post of Same Term
- Parent category / child category posts
- $args for get_terms() to return ORDER BY FIELDS
- Temporarily un-associate term for an amount of time
- How to extract one field from wp_get_post_terms objects?
- Showing HTML if Post is In Certain Taxonomy Term
- Get Custom Post Child Term
- Get fuzzy matches from get_term_by
- Taxonomy Drop Down with hierarchical view using $terms
- How to check if a term is parent to another?
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Add properties to term object
- How to use category slug to echo a page’s content with the same slug
- Can we apply hide empty to get_the_terms?
- Sort categories by custom field in WordPress admin
- How to display custom taxonomy term specific post?
- Why does term get inserted twice when using dynamic slug?
- How to get immediate children of a ‘term’ parent id through ‘get_terms’?
- How to use get_terms() returning only the terms that have posts with a certain custom field value
- Create category after theme setup and modify the default one
- Update term_id to new value wherever it exists, to combine the two.
- wp_set_post_terms struggle :(
- Add subcategories posts to the counts column at the admin’s categories list
- How to show only tagged CPT categories / taxonomies for a custom post type?
- Get category of a taxonomy for a queries object in a loop
- Order terms by creation date
- Unable to retrieve any child terms using get_terms
- WordPress using get_term to retreive slug not working as expected
- Get terms parent ID for conditional IF statement
- Get count for all terms inside a parent term
- add links to list of post terms
- List Terms by category
- When I Use function wp_insert_term() function it gives me Invalid taxonomy object
- How to add a new child category via an SQL statement?
- Why is my post categories not displaying?
- Use get variable when rewritten url in wordpress
- Attempting to filter posts using get_terms
- Issue on Listing Sub Product Categories In Woocommerce
- List the category tree of all the product_cat categories
- Relate term to term?
- How can I filter get_terms with post meta
- Unable to import term_meta in wordpress using wp_cron