Support » Fixing WordPress » Display Post count with single Tag

  • Resolved moe233



    I need to display a single tag and the post count associated with it. For example,

    Summer (4)

    Thanks for assistance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Untested

    //assuming your tag id is 44
    $tags = get_tags('include=44');
    if ($tags) {
    foreach ($tags as $tag) {
    echo '<p>Tag: ' . $tag->name  . '(' . $tag->count . ')</p>';

    Exactly what I wanted!


    I just modified the echo line to create a link to the tag posts (borrowed from posted by you)

    This is great for doing each tag individually, but how about if we wanted to display a tag cloud with the post count on each tag.

    Example, Summer (4), Spring (19), Autumn (7), Winter (2) …etc…

    I looked but there doesn’t seem to be a show_count option on the tags like there is on the categories.


    The reason for a cloud is to let the size ‘describe’ the approximate number of results for each entry in the cloud.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display Post count with single Tag’ is closed to new replies.