exclude multiple terms using get_terms() function

With get_terms(), the exclude parameter takes an array of term IDs, so just add the second term to the array:

$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>';
}

Leave a Comment