你可以这样得到它
$terms = get_terms("my_taxonomy");
$count = count($terms);
if ( $count > 0 )
{
echo "<ul>";
foreach ( $terms as $term )
{
echo "<li>" . $term->name . "</li>";
}
echo "</ul>";
}
否则你也可以这样使用
$term_slug = get_query_var( \'term\' );
$taxonomyName = get_query_var( \'taxonomy\' );
$current_term = get_term_by( \'slug\', $term_slug, $taxonomyName );
$args_list = array(
\'taxonomy\' => \'item\', // or use $taxonomyName for all taxonomies
\'show_count\' => true,
\'hierarchical\' => true,
\'child_of\' => $current_term->term_id,
\'hide_empty\' => \'0\',
\'title_li\' => \'\',
\'echo\' => \'0\',
);
echo wp_list_categories($args_list);