You might have already figured this out, but here’s an example how to get custom taxonomy terms for a post and create a list of links for the found terms.
// used in your custom post type template, e.g. single-movies.php
$genres = get_the_terms( get_the_ID(), 'genres' );
// current post has genre terms attached to it
if ( $genres && ! is_wp_error( $genres ) ) {
$term_links = array();
// build list item links
foreach ($genres as $genre) {
$genre_links[] = sprintf(
'<li><a href="https://wordpress.stackexchange.com/questions/352598/%s">%s</a></li>',
esc_url(get_term_link($genre->term_id, $genre->taxonomy)),
esc_html($genre->name)
);
}
// display genres link list
printf(
'<ul>%s</ul>',
implode('', $genre_links)
);
}
Related Posts:
- Get template part based on custom taxonomy term
- If on term-page -> get the current term?
- Conditional Query of Custom Post Type and custom taxonomy
- How to check if post/page or taxonomy post is published by admin
- Conditional Statements
- If custom taxonomy else conditional [closed]
- How to Add Custom Taxonomy To Woocommerce Plugin
- How to get the posts of a custom taxonomy term
- How can I rewrite URLs to pass taxonomy and post type values to the query?
- Remove Trash / Delete option for Custom Post Type / Taxonomy
- How to filter custom post types by custom category taxonomy
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- remove support for ‘Categories’ for a custom post type
- Hide child term posts on parent term pages
- How to select one major category (or custom taxonomy) for a custom post type?
- Custom taxonomy & post slug permalink
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Want to filter only parent post in admin area
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Child and grandchild taxonomy listings – 404
- Limit taxonomy results to a single cpt
- Display custom taxonomy as dropdown list
- Automatically Add a Category to a Custom Post Type
- Custom Permalink Tag breaks Pagination
- Query to change custom post type with specific category
- Custom Post Type and Custom Taxonomy Permalinks
- Relationship between two taxonomies and a custom post type [closed]
- next_post_link on custom taxonomy
- Show Two custom Post type and their posts on category page
- How many Custom Post Types to register?
- Insert HTML inside link in a walker
- Change Permalink Structure for Tag.php template
- How to bulk copy custom fields between custom posts?
- get_attached_media() on author page not working
- CPT UI change custom taxonomy url
- Search / Filter posts on Title/Content OR Tags
- Show posts from two or more custom taxonomy terms
- Custom taxonomy and custom post type – wrong permalinks and template
- How can I make the slug of the taxonomy also the slug of the custom post
- How to list custom taxonomies in the back end
- How do I display the grand child items of a taxonomy term?
- Custom taxonomy returns 404
- How to get custom posts sub category link
- Top Level pages in wordpress giving 404, but child pages working fine
- Query posts with double taxonomy
- Loop to display custom post type from a custom Taxonomy
- Custom query – get_the_terms not work
- Creating two loops based on different logic
- How to select a template for a custom post type?
- category list with cutom post count
- custom hierarchical taxonomy and custom post type list contains surplus posts
- Custom sidebar for custom post type
- Check if custom post is a parent?
- Show category and tag link as a submenu under custom post type submenu
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Add filter to Admin list for all custom post types by their custom taxonomies
- Single.php for Custom Post Type > Taxonomy > Term
- Add the custom post term to the custom post title
- Display 3 recent posts from one taxonomy
- Display next 3 posts based on custom taxonomy
- Custom post types templates
- prevent sub categories to show up
- Display latest post of taxonomy
- Custom post type and multi taxonomies + customize url
- Custom taxonomy terms hierarchical navigation
- Is it possible to add the Gutenberg block editor to a custom taxonomy?
- What is the best way to structure posts for the same event happening in different years?
- WordPress Custom Taxonomy – If not parent term
- How can I check the rewrite slug of current post type listing page
- Dynamically Adding Posts of Post Type to A List
- Live search by custom tag
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- I cannot display custom posts in custom taxonomy
- How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name [duplicate]
- Custom taxonomy with custom post type template not showing
- Loop to display parent categories in custom taxonomy
- One-Time Script TimeOut for Large Data
- Not Able to List CPT Based on Taxonomy Term
- Filter Term By Parent Term – Custom Post Type
- CPT Efficient way to display posts from different categories with custom query
- How to create default taxonomy term for a custom post type? [duplicate]
- Extensive search filtering and results->PDF in the front-end
- redirect old post type url to new structure url
- How to retrieve the permalink for a specific (custom) term?
- Values inside a custom field to determine which category posts to display
- title tag for custom post type remove taxonomy name from title tag
- Display and Allow users to edit their own profiles
- Remove custom taxonomy ‘post-type’ from post URL
- Create a page selector using taxonomies
- Advanced search form with filters for custom taxonomies and custom fields
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Code to show related posts (custom post type and custom taxonomy/category) is messing with other code
- register_term_meta not working
- the_post_navigation in single page with multiple taxonomies
- Url rewrite with custom post type and taxonomy
- Custom Sort Order for Custom Post Type Taxonomy
- How to add categories to a custom post type using wp_insert_post($new_post);
- Modify permalink of CPT archive to support two taxonomies