From 374b459ff125c0b49cd97deb77ac4dac1fd65510 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 28 Nov 2023 16:59:44 +0100 Subject: [PATCH] refactoring for better local handling --- .../questions-frequentes.php | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.php b/template-blocks/home/questions-frequentes/questions-frequentes.php index 66390a7..5f0b3a2 100644 --- a/template-blocks/home/questions-frequentes/questions-frequentes.php +++ b/template-blocks/home/questions-frequentes/questions-frequentes.php @@ -1,7 +1,20 @@ 1, + 'post_status' => 'publish', + 'post_type' => 'questions', + 'thematiques' => $post_thematique, + 'include_children' => true, + ); + return get_posts($automatic_query_args)[0] ?? null; + } +} ?> @@ -16,11 +29,15 @@ $block_titling = get_field('block_titling_description_datas'); 'taxonomy' => 'thematiques', 'hide_empty' => false, 'parent' => 0 - )); foreach ($thematique_terms as $key => $thematique) { - if ($thematique->slug === "renovation-circulaire") continue; + if ( + $thematique->slug === "renovation-circulaire" + || $thematique->slug === "circulaire-renovatie" + || $thematique->slug === "au-quotidien" + || $thematique->slug === "dagelijks" + ) continue; // $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques');