Title: Tag Description on Tag.php
Last modified: August 19, 2016

---

# Tag Description on Tag.php

 *  Resolved [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/tag-description-on-tagphp/)
 * Howdy, I created a tag.php page to customize my tag archives. I put the following
   code on the page:
 *  <?php tag_description( $tagID ); ?>
 * Thinking it would show my tag descriptions, but it shows nothing. Is something
   wrong with that code?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/tag-description-on-tagphp/#post-1217447)
 * From my notes, this should help:
 *     ```
       <?php
       $term_id='';
         if ( is_tag() ) {
           $term_id = get_query_var('tag_id');
           $taxonomy = 'post_tag';
           $title = 'Tag: ';
         }
         if ( is_category() ) {
           $term_id = get_query_var('cat');
           $taxonomy = 'category';
           $title = 'Category: ';
         }
       if ($term_id) {
         $args ='include=' . $term_id;
         $terms = get_terms( $taxonomy, $args );
         if ($terms) {
           foreach($terms as $term) {
             if ($term->count > 0) {
               echo '<p>' . $title . '<a href="' . get_term_link( $term->term_id, $taxonomy ) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> has ' . $term->count . ' post(s). </p> ';
             }
           }
         }
       }
       ?>
       ```
   
 *  Thread Starter [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/tag-description-on-tagphp/#post-1217465)
 * ummm…. okay. shoot man, I really don’t know php well enough to make even a dent
   in that. Why would I need that much code just to show the description of a tag?
   All I want to do is slap the description of the tag on its page, if the description
   exists.
 * I just tried slapping that code exacting in the template and it just kills the
   page – stops loading completely when that code strikes.
 *  Thread Starter [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/tag-description-on-tagphp/#post-1217467)
 * Well, I’ll be dammed… here it is:
 *  <?php echo tag_description(); ?>
 * I just needed the “echo” in there. Thanks for the kick in the right direction.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Tag Description on Tag.php’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [nickaster](https://wordpress.org/support/users/nickaster/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/tag-description-on-tagphp/#post-1217467)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
