如何显示一个特定的分类类别描述

时间:2015-03-26 11:46:58

标签: wordpress taxonomy

我需要显示一个特定的分类法类别描述及其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;

但它没有用。帮我解决

1 个答案:

答案 0 :(得分:1)

您应该能够执行以下操作:

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