I've searched this site and tried all kinds of ways to exclude categories 1 and 7 from this list, but nothing is working. No errors but doesn't hide the cats either.
Categories 1 and 7 are not empty, but I'd also like to exclude empty categories, so !empty must stay.
<!-- category list with thumbs -->
<?php
$terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy' => 'category') );
if ( ! empty( $terms ) ) {
foreach( (array) $terms as $term ) {
echo '<div class="issue clear"><h3><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . $term->name . '</a></h3>';
echo '<div class="grid col-120 hide"><a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '"><img src="IMG SRC" alt="" /></a></div>';
echo '<div class="grid col-780 fit">'. $term->description . '</div></div>';
}
}
?>
if
statement in yourforeach
if($term->term_id != 7 || $term->term_id != 8)
- alternatively you could put the ids in an array and use something like!in_array()
– Howdy_McGee♦ Mar 19 '14 at 15:40