I'm using the following query in an archive-mypostype.php template to list custom posts with a specific custom field value.
$args = array(
'numberposts' => -1,
'post_type' => 'mypostype',
'meta_key' => 'custom_field_name',
'meta_value' => true,
'paged' => get_query_var( 'paged' ),
);
$wp_query = new WP_Query( $args );
if ( $wp_query->have_posts() ) :
while ( $wp_query->have_posts() ) : $wp_query->the_post();
These posts are assigned to a custom taxonomy. The query works great on the root archive for the custom post type, but viewing each taxonomy archive page displays all posts and not just the posts for the current taxonomy. How do I amend the query so that its possible to only see the posts for the current taxonomy archive?