From 2633d743a8e91c740a7ca05ce53742ce87d1201d Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 8 Apr 2026 16:37:22 +0200 Subject: [PATCH] FEATURE introducing component --- .../post-types/actualites/archive-grid.php | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 template-parts/post-types/actualites/archive-grid.php diff --git a/template-parts/post-types/actualites/archive-grid.php b/template-parts/post-types/actualites/archive-grid.php new file mode 100644 index 0000000..08d969a --- /dev/null +++ b/template-parts/post-types/actualites/archive-grid.php @@ -0,0 +1,52 @@ + $current_post_type, + 'posts_per_page' => $post_amount, + '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, + ), + ); +} + + +$posts_query = new WP_Query($query_args); + +?> + + +
+
+ + $posts_query, + 'current_post_type' => $current_post_type, + 'etiquette_active_filter_slug' => $etiquette_slug, + )); ?> + +
    + have_posts()) : ?> + have_posts()) : $posts_query->the_post(); ?> + get_the_ID(), + )); ?> + + +
+
+
\ No newline at end of file