Support » Fixing WordPress » Show tags of custom post type only

  • Im trying to have a list of all the tags (with links) of my custom post type, excluding the regular post type tags.

    I have tried using a query but it has unusual behaviour. If i have two posts with the same tag ‘buss’ then it lists two separate entities of ‘buss’ where im trying to generate my list.

    Is there anyway this piece of code could be post type specific?

    <?php $terms = get_terms('post_tag');?>
                                <ul>
                                <?php foreach ($terms as $term): ?>
                                    <li>
                                        <a href="<?php echo get_term_link($term->slug, 'post_tag');?>">
                                            <?php echo $term->name; ?>
                                        </a>
                                    </li>
                                <?php endforeach;?>
  • The topic ‘Show tags of custom post type only’ is closed to new replies.