daniel-l
10/5/2017 - 10:51 PM

WP_Query with a tax_query

WP_Query with a tax_query

$args = array( 
               'post_type' => 'gallery', 
               'tax_query' => array(
                   array(
                        'taxonomy' => 'photoarea',
                        'field' => 'fourth', 
                        )
                ),
               'posts_per_page' => 10,
              );

$the_query = new WP_Query( $args );

if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();

     the_post_thumbnail();

 endwhile; endif;

wp_reset_query();

?>