Get tag description and display in WordPress

I’ve been searched for how to get tag description and display in WordPress. I’m not sure whether it works for me, but I’ve found a solution here as below:

$posttags = get_the_tags();
if ($posttags) {
    foreach($posttags as $tag) {
        echo $tag->name;
        echo $tag->description;
    }
}
Share this:

Leave a comment

Your email address will not be published. Non-standard characters in the comment form are not permitted and will be removed. Required fields are marked *