diff --git a/template-publications.php b/template-publications.php index 50580c1..a4ace76 100644 --- a/template-publications.php +++ b/template-publications.php @@ -9,6 +9,7 @@ $posts_per_page = 5; $args = array( 'post_type' => 'brochures', 'posts_per_page' => $posts_per_page, + // 'posts_per_page' => -1, 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', @@ -17,6 +18,15 @@ $args = array( 'meta_compare' => '!=', ); $brochuresPosts = new WP_Query($args); +// $sortedBrochuresPosts = sort_posts_per_thematiques_priority($brochuresPosts); + +// $sortedBrochuresPosts->posts = array_slice($sortedBrochuresPosts->posts, 0, $posts_per_page); +// $sortedBrochuresPosts->found_posts = $posts_per_page; +// $sortedBrochuresPosts->posts_per_page = $posts_per_page; +// $sortedBrochuresPosts->query_vars['posts_per_page'] = $posts_per_page; +// $sortedBrochuresPosts->post_count = $posts_per_page; + + // #### FICHES INFOS QUERY $args = array( @@ -31,6 +41,14 @@ $args = array( ); $fichesInfosPosts = new WP_Query($args); +// $sortedFichesInfosPosts = sort_posts_per_thematiques_priority($fichesInfosPosts); +// $sortedFichesInfosPosts->posts = array_slice($sortedBrochuresPosts->posts, 0, $posts_per_page); +// $sortedFichesInfosPosts->found_posts = $posts_per_page; +// $sortedFichesInfosPosts->posts_per_page = $posts_per_page; +// $sortedFichesInfosPosts->query_vars['posts_per_page'] = $posts_per_page; +// $sortedFichesInfosPosts->post_count = $posts_per_page; + + // #### WEBINAIRES QUERY $args = array( 'post_type' => 'videos-webinaires', @@ -46,6 +64,7 @@ $videosWebinairesPosts = new WP_Query($args); // $videosWebinairesDatas = get_field('videos_webinaires', $current_page_id)['videos_webinaires_datas'] ?? null; $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_posts + $videosWebinairesPosts->found_posts; +// $total_posts_found = $sortedBrochuresPosts->found_posts + $fichesInfosPosts->found_posts + $videosWebinairesPosts->found_posts; ?>