WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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

share|improve this question
up vote 0 down vote accepted

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;
share|improve this answer
This is great man. I appreciate that you took the time to write this, thank you. I should of been a bit more specific and will be in the future. Is there a way to limit the tags to only the ones associated with each post? (Rather than displaying all of them in the database.) – Kapitol Jun 28 '11 at 1:01
See updated A and save the link to the Function Reference. – kaiser Jun 28 '11 at 1:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.