开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜