From d92ea138b17311e5a535d37ddae2d008b04b6d90 Mon Sep 17 00:00:00 2001 From: Nonimart Date: Thu, 9 Oct 2025 14:00:41 +0200 Subject: [PATCH] FEATURE Optimizing explore tags link target and behaviour --- template-parts/articles/articles-grid.php | 27 +++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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(