事件类别是自定义分类法“事件类别”中的术语,因此您应该使用get_terms
而是:
//Args for which terms to retrieve
$args = array(\'type\'=> \'post\', \'order\' => \'ASC\', \'hide_empty\' => 1 );
//Array of taxonomies from which to collect the terms
$taxonomies = array(\'event-category\');
//Get the terms
$terms = get_terms( $taxonomies, $args);
//loop through the terms and display
foreach($terms as $term) {
echo \'<li><a href="#tabs-content-\'.strtolower($term->term_id).\'" title="\' . sprintf( __( "View all posts in %s" ), $term->name ) . \'" \' . \'>\' . $term->name.\'</a></li>\';
array_push($cat_list,"$term->term_id");
}
如果要获取“类别”和“事件类别”分类法的术语,可以将“类别”添加到
$taxonomies
大堆