• I’m using this to pull in a list of categories with titles and thumbnails.
    How can I exclude certain categories by ID?

    Thanks!

    <!-- 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"><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 ) ) . '">' . wp_get_attachment_image( $term->image_id, 'thumbnail-small' ) . '</a></div>';
    		  echo '<div class="grid col-780 fit">'. $term->description . '</div></div>';
    	  }
    
    	}
    	?>

    https://ww.wp.xz.cn/plugins/taxonomy-images/

The topic ‘Exclude categories by ID’ is closed to new replies.