From 158f83be9b1354b80d280dcdf6c3551828083ec7 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 30 Nov 2023 13:09:37 +0100 Subject: [PATCH] webinaire: switching from repeator to post type --- template-publications.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/template-publications.php b/template-publications.php index e9ea5d2..2eec375 100644 --- a/template-publications.php +++ b/template-publications.php @@ -29,14 +29,23 @@ $args = array( 'meta_key' => 'brochure_pdf', 'meta_value' => '', 'meta_compare' => '!=', - // ICI METAQUERY FOR LE PDF ); $fichesInfosPosts = new WP_Query($args); -// #### VIDÉOS & WEBINAIRES QUERY -$videosWebinairesDatas = get_field('videos_webinaires', $current_page_id)['videos_webinaires_datas'] ?? null; +// #### WEBINAIRES QUERY +$args = array( + 'post_type' => 'videos-webinaires', + 'posts_per_page' => -1, + 'post_status' => 'publish', + 'order' => 'DESC', + 'orderby' => 'date', +); +$videosWebinairesPosts = new WP_Query($args); -$total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_posts + count($videosWebinairesDatas); +// #### VIDÉOS & WEBINAIRES QUERY +// $videosWebinairesDatas = get_field('videos_webinaires', $current_page_id)['videos_webinaires_datas'] ?? null; + +$total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_posts + $videosWebinairesPosts->found_posts; ?>
@@ -273,7 +282,7 @@ $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_pos 'template-components/archives/webinaire-rows', null, array( - 'videosWebinairesDatas' => $videosWebinairesDatas, + 'videosWebinairesPosts' => $videosWebinairesPosts, ) ) ?>