Вывод кастомной рубрики
Есть кастомный тип постов, в нем 2 рубрики.
Мне нужно вынести на кастомную страницу эти рубрики по отдельности, пытаюсь вынести их через такой код:
<?php $posts = get_posts( array( 'tax_query' => array( array( 'taxonomy' => 'cat_product', 'field' => 'id', 'terms' => [3] ) ), ) ); $terms = new WP_Query(array('post_type' => 'products','showposts' => '10')); ?> <?php if ($terms->have_posts()) : while ($terms->have_posts()) : $terms->the_post(); ?> <div class="item-block-woo"> <div class="block-centr-i-b-w"> <div class="img-item-block-woo"><?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail( array(663,333), array('class' => 'title-img') ); ?></div> <div class="title-item-block-woo"><?php the_title(); ?> - <?php the_field( "price_prooduct"); ?>Р</div> <div class="bttn-sale"><a href="/">Купить</a></div> </div> </div> <?php endwhile; else: echo 'пусто'; endif; ?> <?php wp_reset_query(); ?>
Но он выводит все рубрики таксономии, а не ту которую я указал в terms.
Упускаю что-то, не могу понять что
решил так: