Viewing 5 replies - 1 through 5 (of 5 total)
  • it could have helped if you’d posted your attempted code to show the description:

    do you want to show the tag description in the same code as above?

    tag_description() takes the tag id to show the description;
    so you could try:

    ><?php
    $posttags = get_the_tags();
    $count=0;
    if ($posttags) {
    foreach($posttags as $tag) {
    $count++;
    if (1 == $count) {
    echo $tag->name . ' ';
    echo tag_description($tag->term_id);
    }
    }
    }
    ?>

    Thread Starter weiler14

    (@weiler14)

    Hi, No I would like to show it seperately from the title.

    This is Not working:
    <?php tag_description( $tagID ); ?>

    thanks!

    Thread Starter weiler14

    (@weiler14)

    this worked: <?php
    $posttags = get_the_tags();
    $count=0;
    if ($posttags) {
    foreach($posttags as $tag) {
    $count++;
    if (1 == $count) {
    echo $tag->description . ‘ ‘;
    }
    }
    }
    ?>

    THANKS!!

    /edit/
    well done, you got it.

    below is the reply i worked on while you solved the problem yourself.
    /end of edit/

    Hi, No I would like to show it seperately from the title.

    but still the description of the tag whos title you just showed?

    in any case you would need to use <?php echo tag_description(); ?> whatever in the brackets.

    in a tag archive, the above might work directly;

    in a post, you would need to get the corresponding tag id (for instance with ‘get_the_tags()’ as you already have), and then use:

    <?php
    $posttags = get_the_tags();
    if ($posttags) {
      foreach($posttags as $tag) {
      echo tag_description($tag->term_id); break;
      }
    }
    ?>
    Thread Starter weiler14

    (@weiler14)

    Thanks for the guidance and helping me solve this

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Please help– Tag DESCRIPTION’ is closed to new replies.