i have a single-post_type.php file where i constructud a breadcrumb (or similer to)
i am currently using this to get the terms of this taxonomy:
$terms = wp_get_post_terms( $post->ID, 'wedding_cat');
.
Later on i am showing that term like this:
<div class="breadcrumbs"><?php $term = array_pop($terms); echo '<a href="'. get_bloginfo('url') .'">'. __('Home', 'sagive') . '</a> » <a href="index.php?page_id=74">'.__('Wedding Rings', 'sagive').'</a> » <a href="'.get_term_link($term->slug, 'wedding_cat').'">'.$term->name.'</a>,'?></div>
That way i am only getting one term which is gr8 but..
i need to exclude a specific term comepletly from apearing.
How can i do that?
I’d use
wp_list_filter()
with the operator ‘NOT’ to compare either the term’s name, slug or ID (depending how you want to test for term to be exluded).Untested but something like this should work (assuming that you want to exclude the term with slug ‘myslug’):
(Of course this may mean
$terms
because empty).