Support » Fixing WordPress » Select certain tags to display instead of all tags.

  • I am displaying all the tags by using this function

    <?php
    $tags = get_tags();
    $html = '<div class="post_tags">';
    foreach ( $tags as $tag ) {
    $tag_link = get_tag_link( $tag->term_id );
    
    $html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
    $html .= "{$tag->name}</a>";
    }
    $html .= '</div>';
    echo $html;
    ?>

    This then prints out all the tags.

    Instead of display all tags is there a way I can say which tags I wish for it to display the slug and link to? So for example I can only display a tag called ‘hello’

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select certain tags to display instead of all tags.’ is closed to new replies.