$paged = (get_query_var("paged")) ? get_query_var("paged") : 1;
$posts = get_posts( array('paged' => $paged) );
$term = get_queried_object();
$term_slug = $term->slug;
$_posts = new WP_Query( array(
'post_type' => 'works',
'posts_per_page' => 10,
'tax_query' => array(
array(
'taxonomy' => 'category', // или вашу таксономию
'field' => 'slug',
'terms' => $term_slug,
),
),
) );
if ( $_posts->have_posts() ) :
while ( $_posts->have_posts() ) :
$_posts->the_post();
get_template_part( 'works-item' );
endwhile;
endif;
wp_reset_postdata();
$term = get_queried_object();
$term_slug = $term->slug;
$_posts = new WP_Query( array(
'post_type' => 'women',
'posts_per_page' => 10,
'tax_query' => array(
array(
'taxonomy' => 'region',
'field' => 'slug',
'terms' => $term_slug,
),
),
) );
if ( $_posts->have_posts() ) :
while ( $_posts->have_posts() ) :
$_posts->the_post();
get_template_part( 'template-parts/content', 'women' );
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_postdata();