diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.php b/template-blocks/home/questions-frequentes/questions-frequentes.php index 5f0b3a2..a6c3f8d 100644 --- a/template-blocks/home/questions-frequentes/questions-frequentes.php +++ b/template-blocks/home/questions-frequentes/questions-frequentes.php @@ -8,11 +8,11 @@ if (!function_exists('get_automatic_post')) { 'post_per_page' => 1, 'post_status' => 'publish', 'post_type' => 'questions', - 'thematiques' => $post_thematique, 'include_children' => true, ); - return get_posts($automatic_query_args)[0] ?? null; + $posts = new WP_Query($automatic_query_args); + return $posts->posts[0] ?? null; } } @@ -44,6 +44,10 @@ if (!function_exists('get_automatic_post')) { $manual_data = get_field($thematique->slug . '_manual_data'); $post_datas = $manual_data ? $manual_data : get_automatic_post($thematique->slug); + echo '
'; + print_r(get_permalink($post_datas)); + echo ''; + get_template_part( 'template-components/cards/card-frequent-question', null,