• Resolved Kreactiva

    (@kreactiva)


    Hi, I need to be able to display inside the article, in “single.php” of my template, the TAGS of that article with their corresponding descriptions.

    So far I’ve only managed to show ALL the tags of the site with this code:

     $tags = get_tags( array( 'hide_empty' => false ) );
     if ($tags) {
       foreach ($tags as $tag) {
         if ($tag->description) {
           echo '<dt><a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a></dt><dd>' . $tag->description . '</dd>';
         }
       }
     }

    but I would need to show ONLY the TAGS with their description of the article you are in.

    Can someone help me?

    Thank you very much.

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

The topic ‘tag_description in articles’ is closed to new replies.