How to show Tag Description in my wordpress template.

Discussion in 'WordPress' started by psharma, Aug 9, 2010.

  1. #1
    My wordpress template do not support tag description.
    I have installed a plugin Rich Text Tags which allows me to create html description for tags.
    I want that whenever a tag is clicked its description shows before the list of posts.

    thanks
     
    psharma, Aug 9, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you have a tag template (tag.php), open it and insert this after the heading:
    <?php echo tag_description(); ?>

    For the TwentyTen theme, I would code it like this:
    
    <h1 class="page-title"><?php
    	printf( __( 'Tag Archives: %s', 'twentyten' ), '<span>' . single_tag_title( '', false ) . '</span>' );
    ?></h1>
    <p class="tag-description"><?php echo tag_description(); ?></p>
    
    Code (markup):
     
    Cash Nebula, Aug 10, 2010 IP
  3. psharma

    psharma Prominent Member

    Messages:
    1,955
    Likes Received:
    85
    Best Answers:
    4
    Trophy Points:
    345
    #3
    I do not find any tag template. That is the problem.
     
    psharma, Aug 10, 2010 IP
  4. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The TwentyTen tag template might work if your theme is similar. Put the above code in it and try it out.

    If that fails, post your category template here and I will try to make a tag template from it.
     
    Cash Nebula, Aug 11, 2010 IP
    psharma likes this.
  5. psharma

    psharma Prominent Member

    Messages:
    1,955
    Likes Received:
    85
    Best Answers:
    4
    Trophy Points:
    345
    #5
    Thanks anyways. But I need a very different theme because of a rare niche. twentyten do not work for me. Now I will try to find out the the similar code in my theme to solve the problem. However I tried earlier but failed.
     
    psharma, Aug 11, 2010 IP
  6. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You're welcome :) The category template is the closest one to the tag template so that is a good start.
     
    Cash Nebula, Aug 11, 2010 IP
  7. psharma

    psharma Prominent Member

    Messages:
    1,955
    Likes Received:
    85
    Best Answers:
    4
    Trophy Points:
    345
    #7
    There is no category template as well :(
     
    psharma, Aug 11, 2010 IP
  8. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #8
    :rolleyes: So it probably doesn't have a 404 template either. If it's a Wordpress 3 theme, the main file (index.php) is the next closest. But I would be looking for a new theme.
     
    Cash Nebula, Aug 11, 2010 IP
  9. psharma

    psharma Prominent Member

    Messages:
    1,955
    Likes Received:
    85
    Best Answers:
    4
    Trophy Points:
    345
    #9
    Yes, I have changed the theme. It didn't contained any tag term in archives, index, archive, 404, or any other file.
     
    psharma, Aug 11, 2010 IP