sorting posts per thematique
This commit is contained in:
parent
35d9d8c711
commit
cda5ce3013
|
|
@ -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;
|
||||
|
||||
?>
|
||||
<div class="template-archives template-archives--publications">
|
||||
|
|
@ -237,10 +256,6 @@ $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_pos
|
|||
-----------------*/ ?>
|
||||
<?php
|
||||
$sharePublications = get_field('section_share_publications', $current_page_id);
|
||||
// echo '<pre>';
|
||||
// print_r($sharePublications);
|
||||
// echo '</pre>';
|
||||
|
||||
?>
|
||||
|
||||
<!-- <div id="highlighted-share-publication" class="highlighted-publication highlighted-share-publication">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user