moving get°automatic posts from utilities to blok questiopns frequents template file

This commit is contained in:
Antoine M 2023-11-28 17:00:46 +01:00
parent 374b459ff1
commit 8afb801d3b

View File

@ -73,16 +73,16 @@ function getMainThematique($thematique)
// Get automatic post used in BLOCK QUESTIONS FREQUENTES // Get automatic post used in BLOCK QUESTIONS FREQUENTES
function get_automatic_post($post_thematique) // function get_automatic_post($post_thematique)
{ // {
$automatic_query_args = array( // $automatic_query_args = array(
'post_per_page' => 1, // 'post_per_page' => 1,
'post_status' => 'publish', // 'post_status' => 'publish',
'post_type' => 'questions', // 'post_type' => 'questions',
'thematiques' => $post_thematique, // 'thematiques' => $post_thematique,
); // );
return get_posts($automatic_query_args)[0] ?? null; // return get_posts($automatic_query_args)[0] ?? null;
} // }
// TO GET ARCHIVE RELATED PAGES BY TEMPLATE // TO GET ARCHIVE RELATED PAGES BY TEMPLATE