Search code examples
wordpresstaxonomy

How to display one specific taxonomy category desciption


I need to display one specific taxonomy category description with its id.Tried with this code

$term_id = 9;
$taxonomy_name = 'service-item-tax';
$term = get_term_by('id', $term_id, $taxonomy_name );
echo $term->description;

But it didnt work.Help me to fix


Solution

  • You should just be able to do the following:

    echo term_description('TERM_ID','TAXONOMY_SLUG');