hi!
I’m creating a blog layout and want to add related posts section, based on a custom taxonomy (plantes_sauvages) . I’v read tons of topics and tried tons of queries, but noting is working.
The code I have is this, but the post shown are not related to the custom taxonomy:
$tax_query[] = array(
'tax_query' => array(
array(
'taxonomy' => 'plantes_sauvages',
'field' => 'slug',
'terms' => '{{dc:term:slug}}',
'operator' => 'IN',
)
),
);
$query = array(
'post_type' => 'post',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => 5,
'orderby' => 'title',
'order' => 'desc',
'tax_query' => $tax_query
);
var_dump( http_build_query( $query ) );
Thanks for your help!
Michaël