It works the same way within any Loop for any post type and taxonomy, get_the_ID()
retrieves the current post’s ID. Taken from the Codex basic example for get_the_terms
:
$terms = get_the_terms( get_the_ID(), 'genre' );
if ( $terms && ! is_wp_error( $terms ) ) {
foreach ( $terms as $term ) {
echo $term->name;
}
}
Related Posts:
- Get terms by taxonomy AND post_type
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Taxonomy, Terms, and Template Files
- Get Custom Taxonomy ID within loop
- Custom Post Types not showing on Custom Taxonomy archive page
- custom post type or taxonomy
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Highlight menu item when on a custom post type?
- Changing the priority of a custom taxonomy’s metabox
- How to list all categories and tags in a page?
- How to setup a Custom Taxonomy Term template
- Admin to user notices – best practices?
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Many to Many Taxonomies or rewrite rules?
- Query posts by custom post type and custom taxonomy
- Custom Taxonomy List links being re-written
- front end radio custom taxonomy with custom post type
- How to display the rest of categories on Portfolio filterable
- Bulk 301 redirect for custom post type
- How to query custom post type by term?
- Associate Taxonomies Across Post Types
- ‘category__and’ for custom taxonomy?
- Custom post query by taxonomy
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- How can I show recent posts from same taxonomy as the post currently being viewed?
- How to get the first term for the current taxonomy?
- Group custom posts by custom taxonomy names
- Display Posts in Custom Post Types Timber
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Get post from custom post type order by two taxonomies
- How to convert custom post type based list to a dropdown list?
- Wrong request query on cpt and tax
- Getting a PHP Notice when using Pods with WPML [closed]
- Custom Taxonomy Archives on Custom Post type Page [duplicate]
- Custom post type multiple loop by taxonomy term
- Extending AZIndex plugin to use custom post types and custom taxonomies
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- How to Filter custom post type by taxonomy?
- Listing posts under primary and secondary taxonomies
- What’s the WP way to load remaining custom posts?
- Is it better to use WordPress Custom Post Types or Taxonomies?
- Search by tag name and category
- Listing custom terms in custom post meta
- WordPress subpages to custom post types
- get_the_title() is returning results from previous loop
- How do I display a list showing custom post types nested within a taxonomy?
- Display posts with tag for custom post type only
- Can’t use pagination with custom taxonomy
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- How to show all taxonomies within custom post type loop
- Showing taxonomy terms on custom post type
- Custom Search | check multiple meta_value for search value
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How to list custom post types on a custom post type page?
- Custom post type categories gives 404 error
- Using WP_Query, I want to show posts that are associated with a custom taxonomy term
- Query Posts that have Custom Taxonomy
- Custom Taxonomy Terms in Menu lead to which page?
- Foreach loop returning more than one item when querying taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Most viewed post of custom post type
- Custom taxonomy and post type rewrite rules
- Custom post type page with parameter
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- How can I loop at a Specific Taxonomy from a custom post type?
- Check that a slug is present in the get_terms request
- Display custom post type taxonomy in a WordPress excerpt for current post
- Tags being removed upon updates to related posts: ACF/Genesis/WP5.4.1
- How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?
- pagination problem listing custom post types of taxonomy in wordpress
- Display CPT taxonomies as an archive page
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- How to manage a dynamic multi-level page hierearchy system?
- Templates for CPT not working
- Register post type getting error 404
- Which File Populating CPTs in Slug URL
- Add tags to a “pending” post before publishing
- Show posts for current taxonomy
- order taxonomy alphabetical
- Display all Custom taxonomy terms and their relevant custom posts
- WordPress get all post with like in terms [duplicate]
- Custom post type archive page not showing on archive-posttype.php
- Query Pulling the same post twice
- Cannot retrieve Custom Taxonomies (Disappeared)
- Custom Post type and Taxonomy in post URL error
- Render custom taxonomy query as single template
- Custom meta-box for all custom post types
- Loop multiple taxonomy in custom post
- Sort a custom post type loop by a custom taxomomy instead of chronologically
- How to Create Custom Post Type with Multiple Color Options?
- Add custom taxonomies as class names to an archive page of custom post types
- Custom My account page and custom page for editing posts
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Require Custom Taxonomy for Custom Type
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Custom Post Type urls not working
- Create a hierarchical list of posts that’s grouped and nested by category
- Show a wordpress custom post condtionally using a category term