diff --git a/template-parts/articles/articles-grid.php b/template-parts/articles/articles-grid.php index 441985c..965d42e 100644 --- a/template-parts/articles/articles-grid.php +++ b/template-parts/articles/articles-grid.php @@ -1,9 +1,26 @@ 'articles', 'posts_per_page' => -1, 'post_status' => 'publish', -)); +); + +// Si on a une étiquette, ajouter le filtre taxonomy +if (!empty($etiquette_slug)) { + $query_args['tax_query'] = array( + array( + 'taxonomy' => 'etiquettes', + 'field' => 'slug', + 'terms' => $etiquette_slug, + ), + ); +} + +$articles = new WP_Query($query_args); $post_count = $articles->post_count; $authors = get_posts(array( 'post_type' => 'auteurs', @@ -36,9 +53,11 @@ $thematiques = get_terms(array(