具有get_terms()
, 这个exclude
参数接受一个术语ID数组,因此只需将第二个术语添加到数组中:
$terms = get_terms( TribeEvents::TAXONOMY, array(
\'orderby\' => \'name\',
\'order\' => \'ASC\',
\'exclude\' => array( 77, 71 ),
) );
echo \'<li>Category:</li>\';
foreach ( $terms as $term ) {
echo \'<li><a href="\'.$url.\'?tribe_eventcategory=\'.$term->term_taxonomy_id.\'">\'.$term->name.\'</a></li>\';
}