WebElain was correct but, you’ve also got the HTML escaped. The entire chunk of code should be:
function thb_display_category_cus() {
if ('portfolio' === get_post_type() ) {
$categories = get_the_term_list( get_the_ID(), 'portfolio-category', '', ', ', '' );
echo $categories
} else {
the_category(', ' );
}
}
Related Posts:
- Automatically check parents (in a taxonomy) when child is selected
- Creating “static” taxonomies to choose from, inside custom post type?
- How to get current_cat in navbar, in single post
- How can I get posts in a subcategory to display on it’s parent categories archive page?
- How can I select a primary category?
- Custom taxonomy: same terms, but for different years
- Custom category order with get_categories
- get_terms return errors
- How to show only Standard Format post in my custom taxonomy page -wordpress 3.8.1
- Custom sidebar category listing?
- Reproducing hierarchical list output from wp_list_categories(), using get_categories()
- Fast way to add countries as a custom taxonomy term?
- Auto add taxonomy if post has category
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- How to Register and Display Widget for Custom taxonomy
- Any way to assign Post Categories and Tags to Links?
- Show Custom Taxonomy Slug(s)?
- Add custom taxonomy under the category title
- How to add more than one RSS Feed Link for wordpress
- Custom Taxonomy Archive not displaying entries
- Exclude custom taxonomy tag from loop
- Hide custom field if empty
- How to view WordPress’ default category IDs?
- Filter posts by custom taxonomy terms
- Customize the WordPress Default Gallery Output
- Show posts on a page based on a category and tag(s)
- Query posts by category AND custom field, then ORDERBY another custom field – help!
- How to use
- How to add “Read More…” link in twentytwenty
- Taxonomy linked to pages
- Function to remove archive sidebar for custom taxonomy?
- how to get the categories for a single product in a hierarchical way
- Category selectable homepage
- How to add textarea field to taxonomy (tag)?
- How to change the category url jusy show /category/%category_id% in wordpress?
- How can I get the custom post type assigned to a current custom taxonomy for query?
- wp_query get post custom taxonomy in search.php
- Filtering *out* a taxonomy from the admin post list
- How do I apply style to each category of a list?
- How can I create a permalink with two categories, with the order based on the parent category?
- Redirect to another page using contact form 7? [closed]
- How to get every custom taxonomy names and urls?
- Get Custom Taxonomy Terms by Date
- Display specific Taxonomy Term from Custom Post Type
- Semi complicated custom taxonomy question
- Get wordpress taxonomy slug name(s) to use as div class
- How do I create a root link in wordpress to a PDF file?
- Position a hard-coded menu item
- Show custom field value as a link
- How to auto add nofollow to links in custom field?
- Get whole linked with wp_list_pages
- Adding Multiple “Parents” in get_categories
- Echo the Last Child Taxonomy only (not parents)?
- How to query term_id of a Custom Taxonomy by name
- How to setup a membership system in WordPress?
- Make the home page template my archive/category page template without code duplication
- How to show parent taxonomy using get_the_terms?
- wp_insert_post custom taxonomy multiple Category not added
- Open login logo URL in new tab
- Get custom text if in Category
- query variables for custom taxonomies
- Create Miltiple Category Base
- If Term Name Exists, Append a Unique ID to Slug
- Best practice to generate token for email action
- Display all subterms of a custom taxonomy filtered by parent terms
- My list of terms of custom taxonomy displays 7 times
- Is it possible to edit a wordpress category with Gutenberg?
- Display Custom Taxonomy Name As A Shortcode
- How to show related post with category DESC (ASC) IDs of ID current post
- New to WP: links on static homepage are not working
- Taxonomy template is not reading
- Hide entry-header for a specific category
- URL issue after setting up Custom Structure in Settings >> Permalinks
- How to assign a default/priority taxonomy to be shown in url in case two taxonomy items are selected
- How can I add category variable inside posts?
- Set a Default CPT taxonomy by taxonomy id
- How to change custom link of subpages from of localhost to website
- Post filter with multiple checkbox taxonomy terms
- Combine Categories & Custom Taxonomy
- remove or hide Link Relationship (XFN) form Menus tab
- Structure of post types for TV Shows and episodes
- Custom dropdown search form that allows users to select option B based from Option 1
- Filter custom taxonomy posts via AJAX
- Adding images to anchors in the list created and fetched with wp_nav_menu
- issue with saving custom metaboxes fields
- How do I map two domains to the same wordpress installation?
- How to add a post with new Taxonomy without assigning to default category?
- Taxonomy template by post type
- How to loop through 1 CPT with 2 Taxonomies
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- Custom terms in custom category taxonomy
- Custom WP deactivate an email activation link sent to user’s email.
- How to setup a taxonomy that can have only one post assigned to it?
- featured images – custom links
- Grouped custom taxonomy query
- Delete Term via edit-tags.php
- Create advanced portal website with sections – taxonomy usage?
- Custom Query for Taxonomy
- Post thats in Two Categories, only want to display name for one
- Adding a third custom taxonomies