I am using this code and its echoing all the taxonomies available for the particular CPT. I am calling this in a single-posttype.php to show taxonomies. What i need is to display only the taxonomies tagged to the current post-type instead of displaying all the taxonomies available. Please help.


        $taxonomy = 'map_feature';
        $terms = get_terms($taxonomy);

        if ( $terms && !is_wp_error( $terms ) ) :
        <?php foreach ( $terms as $term ) { ?>
        <li><a href="<?php echo get_term_link($term->slug, $taxonomy); ?>">
        <?php echo $term->name; ?></a></li>
        <?php } ?>
        <?php endif;?>

Read more here: How to show only tagged CPT categories / taxonomies for a custom post type?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: