handling posts sorting

This commit is contained in:
Antoine M 2023-12-14 17:24:23 +01:00
parent cda5ce3013
commit 9a3879d4e9

View File

@ -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();