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);
}
}
}
?>
Hi, No I would like to show it seperately from the title.
This is Not working:
<?php tag_description( $tagID ); ?>
thanks!
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;
}
}
?>
Thanks for the guidance and helping me solve this