diff --git a/includes/api.php b/includes/api.php index 2dea4fa..e909f8a 100644 --- a/includes/api.php +++ b/includes/api.php @@ -224,13 +224,14 @@ function build_brochure_archive_rows(WP_REST_Request $request) 'tax_query' => $tax_query, ); $brochuresPosts = new WP_Query($args); + $sortedBrochuresPosts = sort_posts_per_thematiques_priority($brochuresPosts); ob_start(); get_template_part( 'template-components/archives/brochure-rows', null, array( - 'brochuresPosts' => $brochuresPosts, + 'brochuresPosts' => $sortedBrochuresPosts, ) ); $html_template = ob_get_clean(); @@ -280,13 +281,14 @@ function build_fiches_info_archive_rows(WP_REST_Request $request) 'tax_query' => $tax_query, ); $ficheInfoPosts = new WP_Query($args); + $sortedficheInfoPosts = sort_posts_per_thematiques_priority($ficheInfoPosts); ob_start(); get_template_part( 'template-components/archives/fiche-info-rows', null, array( - 'fichesInfosPosts' => $ficheInfoPosts, + 'fichesInfosPosts' => $sortedficheInfoPosts, ) ); $html_template = ob_get_clean();