Display Recently Added Custom Post Types with Custom Taxonomy Shortcode
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>’; }