<?php
// get current taxonomy product term
$post_product = get_the_term_list($post->ID, 'product', '', ', ');
echo 'Product : '.$post_marque;
// get current taxonomy brand term
$post_brand = get_the_term_list($post->ID, 'brand', '', ', ');
echo 'Brand : '.$post_brand;
// make the custom query
$do_not_duplicate = $post->ID;
$taxquery = new WP_Query( $taxquery_args ); while($taxquery->have_posts()) : $taxquery->the_post();
if( $post->ID == $do_not_duplicate ) continue;
$taxquery_args = array(
'post_type' => 'any',
'posts_per_page' => 10,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'nommarque''brand',
'field' => 'slug',
'terms' => $post_marque
)
,
array(
'taxonomy' => 'nommateriel''product',
'field' => 'slug',
'terms' => $post_product
)
)
);
the_permalink();
var_dump($taxquery);
endwhile; wp_reset_postdata(); ?>