您可以尝试修改查询,以便在foreach
, 工作方式与!empty()
. 一个未经测试的示例:
<!-- category list with thumbs -->
<?php
$terms = apply_filters( \'taxonomy-images-get-terms\', \'\', array(\'taxonomy\' => \'category\') );
$exclude = array(1,7); //add the category IDs to exlcude here
if ( ! empty( $terms ) ) {
foreach( (array) $terms as $term ) {
//check the category\'s ID and output code
//if it\'s not in the $exclude array
if ( ! in_array($term->term_id, $exclude) ) {
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 in_array
}//for each
}//if empty
?>