I have someting like this:
$terms = get_the_terms( get_the_ID(), 'kosmetyki_dystrybutor');
$terms_ids = [];
foreach ( $terms as $term ) {
$terms_ids[] = $term->term_id;
}
$args = array(
'post_type' => 'kosmetyki',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'kosmetyki_dystrybutor',
'field' => 'term_id',
'terms' => array($term->term_id)
)
),
);
$query = new WP_Query($args);
if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();
?>
//here posts
<?php endwhile;
endif;?>
But not working. I need posts from taxonomy 'kosmetyki_dystrybutor'. Each 'dystrybutor' need own posts list. What I do wrong? Thx for help :)
$term
coming from? 2) Have you tried anything where//here posts
is?the_post()
doesn't do anything on its own.$term
coming from?