时雨小径 May the Spirit be with you

Get posts by custom taxonomy in Wordpress

<?php 

$post_type = 'publication';
$taxonomy = 'pub_category';
$slug = 'technical-reports';

$args = array(
'post_type' => $post_type,
'posts_per_page' => 5,
'tax_query' => array(
	array(
		'taxonomy' => $taxonomy,
		'field' => 'slug',
		'terms' => $slug
		)

	)

);
$my_query = new WP_Query(); $my_query->query($args);
if ( have_posts() ) : while ( have_posts() ) : the_post(); 
endwhile; endif; 

?>