How to show multiple post types on taxonomy archive?

As you point out, if you want separate loops for different post types you’ll need to use a separate WP_Query() for post type. In the template you can get the current term (ID) being viewed via: get_queried_object_id() (see source)

$args = array( 
          'post_type' => 'staff',
          'tax_query' => array( 
             array(
              'taxonomy' => 'themes',      
              'terms' => get_queried_object_id(),
              'field' => 'id'
             )
          ),
        );
$staff = WP_Query( $args );

Leave a Comment