Get term name by term id
I have a term product开发者_如何学Python
with term id 123
.
How can I use the term id 123
to get the term name?
http://api.drupal.org/api/drupal/modules--taxonomy--taxonomy.module/function/taxonomy_get_term/5
place this function in template file
function getTermsName($taxnomyid){
$terms = taxonomy_get_term($taxnomyid);
$termsname = $terms->name;
return $termsname;
}
and use <?php echo getTermsName($taxnomyid); ?>
to print term name wherever you want
$taxonomyid
is your term id
精彩评论