<?php wp_reset_postdata(); $args = array( 'post_type' => 'posttype', 'posts_per_page' => 20, 'tax_query' => array( array( 'taxonomy' => 'taxonomy', 'field' => 'slug', 'terms' => 'subcategory', ), ), ); $query = new WP_Query( $args ); ?> <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?> <?php endwhile; endif; ?> <?php wp_reset_postdata(); ?>