Use get_the_terms to fetch terms for a specific post:
$terms = get_the_terms( $cpt_post['ID'], 'location' );
if ( $terms && ! is_wp_error( $terms ) ){
$output .= '<div class="cpt-meta">';
foreach ( $terms as $term ) {
$output .= $term->name . ' ';
}
$output .= '</div>';
}
Related Posts:
- Create a shortcode to display custom post types with a specific taxonomy
- Generate Shortcodes by Taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Custom Post Type Loop within Shortcode
- Get custom post type list for every category shortcode
- How to display class name in this shortcode post query
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Display CPT Category List as Shortcode
- Custom post type shortcode with taxonomy attribute not working and no errors
- Shortcode in excerpt
- Plugin Error on activating
- Shortcode display CPT Query only showing 1 post?
- How to Create Short Code Using Custom Post type
- trying to display custom post type with custom taxonomy value by shortcode can’t works [closed]
- Problem with shortcode
- Add Shortcode functionality to a function that queries custom post type / taxonomy
- Combining Multiple Taxonomies in one URL
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- Why does my custom taxonomy show a total count across all post types
- ‘No pages found’ in Dashboard after registering custom taxonomy
- Custom Post Type with Nested Taxonomy and Template Files
- How to display recent posts added in custom post types
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- 404 error PageNavi custom type taxonomy | wordpress
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Query for posts in 2 taxonomies
- Permalinks when filtering multiple custom post types by single taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- custom taxonomy archive by year
- How can I filter by taxonomy on a custom post type’s page?
- Can custom taxonomies items have attached properties?
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Get custom fields from a custom post type with a shortcode
- Update post terms with custom taxonomy
- Deleting Custom Taxonomy Term only increments tag_ID
- Listing tags from a custom post type
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- How do I display the taxonomy term alongside the post type post title?
- Get related posts of child term of custom post type
- Filter term taxonomy metabox in custom post type
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Custom Post, set object Taxonomy terms in plugin
- Hierarchy and access control for Custom Post Types (CPT)
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- WP_Query parameter conflict
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Display custom posts for each category from its custom taxonomy
- Get custom category ID of current custom post within the loop
- Add filter to Admin list for all custom post types by their custom taxonomies
- Single.php for Custom Post Type > Taxonomy > Term
- Displaying custom taxonomy menu in custom post type archive
- Custom post types templates
- prevent sub categories to show up
- Custom post type category link redirecting to 404 page
- Archive page URL for custom taxonomy and post type
- Custom Post Type Archive Page showing as 404
- 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?
- Dynamically Adding Posts of Post Type to A List
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- 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]
- How to get post type archive category title
- Remove CPT Slug with 2 taxonomies and 1 post meta
- Custom taxonomy with custom post type template not showing
- Loop to display parent categories in custom taxonomy
- One-Time Script TimeOut for Large Data
- CPT Efficient way to display posts from different categories with custom query
- Associate custom categories to different user IDs
- How to create default taxonomy term for a custom post type? [duplicate]
- Extensive search filtering and results->PDF in the front-end
- archive-{custom_post_type}.php not getting recognized wordpress
- How to retrieve the permalink for a specific (custom) term?
- Values inside a custom field to determine which category posts to display
- Taxonomy and Rewrite Structure
- Pagination for a Custom Taxonomy
- Trying to create hierarchy between 3-4 custom post types
- title tag for custom post type remove taxonomy name from title tag
- Nested loop called with shortcode duplicating the content above the main loop
- Create a page selector using taxonomies
- Advanced search form with filters for custom taxonomies and custom fields
- Only One Post of Custom Post Type Appearing on Template Page
- Code to show related posts (custom post type and custom taxonomy/category) is messing with other code
- register_term_meta not working
- How can I show second most recent post in sidebar, if most recent post is open in the browser?
- Get term link of shared taxonomy between multiple post types
- Custom post type with custom taxonomies structure url not working archive of CPT
- Make term slugs of custom taxonomy available in WP REST API for custom post type?
- Custom Field in Page Title
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop
- Generate list of posts on a page, but fill shortcode values from ACF fields on that page