Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Wp Query with taxonomy

// WP_Query arguments
$args = array(
	'post_type'              => array( 'cpt' ),
	'nopaging'               => false,
	'posts_per_page'         => '15',
	'order'                  => 'DESC',
	'tax_query'              => array(
		array(
			'taxonomy'         => 'category',
			'terms'            => 'featured',
			'field'            => 'slug',
		),
	),
);

// The Query
$wp_query = new WP_Query( $args );

// The Loop
if ( $wp_query->have_posts() ) {
	while ( $wp_query->have_posts() ) {
		$wp_query->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();