Display only one level subcategory in wordpress
I’m going to guess here. I assume you are using the Taxonomy Images plugin? This: if($term->term_id == $categories_item->term_id) { Can be changed to: if($term->term_id == $categories_item->term_id && $term->parent == $categories_item->cat_ID) { Hereby, you check if the parent ID of the term is the same as the ID of the categories_item.