Could not understand the output of a separate record type and taxonomy There is a separate type of records "estate" and the taxonomy "Recommended" (which applies to almost all types of records) recom and I want to derive from the term recomend

There is a slider to it

<div class="row"> <div class="item"> <ul id="content-slider" class="content-slider"> <li> <h3>1</h3> </li> <li> <h3>2</h3> </li> <li> <h3>3</h3> </li> <li> <h3>4</h3> </li> <li> <h3>5</h3> </li> <li> <h3>6</h3> </li> </ul> </div> </div> 

How to draw a normal conclusion from the type of estate and taxonomies Recommended?

Did this:

 <div class="row"> <div class="item"> <ul id="content-slider" class="content-slider"> <?php $the_query = new WP_Query(array( 'post_type' => 'estate', 'taxonomy' => 'recomend', 'posts_per_page' => 12 )); while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <li> <?php the_post_thumbnail('lg');?> </li> <?php endwhile; wp_reset_postdata();?> </ul> </div> </div> 

But as a result, only all records are displayed, and not from the recommended ones.

    1 answer 1

    I decided everything in this way

     <div class="row"> <div class="item"> <ul id="content-slider" class="content-slider"> <?php $args = array( 'post_type' => 'estate', 'tax_query' => array( array( 'taxonomy' => 'recom', 'field' => 'slug', 'terms' => 'recomend' ) ) ); $estate = new WP_Query( $args ); if( $estate->have_posts() ) { while( $estate->have_posts() ) { $estate->the_post(); ?> <li> <?php the_post_thumbnail('lg');?> </li> <?php } } else { echo 'На данный момент нету рекомендуемых'; } ?> </ul> </div>