Есть код вывода изображений категорий, нужно его дополнить чтоб выводились только картинки текущей

$cat_id = get_query_var('cat');
$catlist = get_categories('hide_empty=0&hierarchical=true' . $cat_id);
foreach($catlist as $categories)
{
    $terms = apply_filters( 'taxonomy-images-get-terms', '' );
    if ( ! empty( $terms ) ) {

      foreach( (array) $terms as $term ) {
        if($term->term_id == $categories->term_id) {
           print wp_get_attachment_image( $term->image_id, '' );
        }
      }    
}}

Ответы (0 шт):