diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.php b/template-blocks/home/questions-frequentes/questions-frequentes.php index 7607326..52e4f4c 100644 --- a/template-blocks/home/questions-frequentes/questions-frequentes.php +++ b/template-blocks/home/questions-frequentes/questions-frequentes.php @@ -9,6 +9,14 @@ if (!function_exists('get_automatic_post')) { 'post_status' => 'publish', 'post_type' => 'questions', 'include_children' => true, + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'slug', + 'terms' => $post_thematique->slug, + 'include_children' => true, + ) + ) ); $posts = new WP_Query($automatic_query_args); @@ -42,7 +50,7 @@ if (!function_exists('get_automatic_post')) { // $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques'); $manual_data = get_field($thematique->slug . '_manual_data'); - $post_datas = $manual_data ? $manual_data : get_automatic_post($thematique->slug); + $post_datas = $manual_data ? $manual_data : get_automatic_post($thematique); get_template_part( 'template-components/cards/card-frequent-question', @@ -52,6 +60,7 @@ if (!function_exists('get_automatic_post')) { 'post_ID' => $post_datas->ID, 'post_title' => $post_datas->post_title, 'post_excerpt' => $post_datas->post_excerpt, + // 'post_url' => $post_datas->post_excerpt, ) ); }