2016-10-07 142 views

回答

3

如果你已經有了term_id

term_description($ term_id,$分類):https://codex.wordpress.org/Function_Reference/term_description

term_description($term_id, 'release_category'); 

如果你只知道文章ID

首先,你必須得到具有wp_get_post_terms($ post_id,$ taxonomy,$ args)的帖子分類法:https://codex.wordpress.org/Function_Reference/wp_get_post_terms

$taxonomies = wp_get_post_terms(get_the_ID(), 'release_category', array('fields' => 'all')); 
foreach($taxonomies as $taxonomy) { 
    echo $taxonomy->description; 
} 
相關問題