How to enable all Tag Descriptions in loop?

As the title states all I’m trying to do is get the descriptions for all tags inside the loop on my INDEX.php page to show up.

I know you can use code to call specific tag descriptions but I want to avoid that if possible since I’ll have hundreds of tags all of which I want to show descriptions for.

Read More

Is there a way to modify the get_tags tag in the loop to display descriptions following each tag?

Related posts

Leave a Reply

1 comment

  1. Modified from the get_tags() Codex Example

    $tags = get_the_tags(); // for the specific post
    // $tags = get_tags(); // all tags
    $html = '<div class="post_tags">';
    foreach ( $tags as $tag )
    {
        $tag_link = get_tag_link( $tag->term_id );
    
        $html .= "Describtion for ".ucfirst( strtolower( $tag->name ) ).": $tag->description";
        $html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>{$tag->name}</a>";
        }
    
    $html .= '</div>';
    echo $html;