From ecf0cc70af7fd7a84ec68d53b04b5f7c9c220203 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 27 Oct 2023 16:08:06 +0200 Subject: [PATCH] updating chapter header with better to improve flexibility --- .../post-conseils/chapter-header.css | 6 ++--- .../post-conseils/chapter-header.php | 26 ++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/template-components/post-conseils/chapter-header.css b/template-components/post-conseils/chapter-header.css index 8d500ce..729079c 100644 --- a/template-components/post-conseils/chapter-header.css +++ b/template-components/post-conseils/chapter-header.css @@ -25,9 +25,9 @@ .cta { @apply my-8; } - time { - @apply bg-white block py-2 mt-6 px-6 w-fit rounded-3xl; - } + /* time { + @apply bg-white block py-2px-6 w-fit rounded-3xl; + } */ } /* .post-conseil-page--acoustique & { diff --git a/template-components/post-conseils/chapter-header.php b/template-components/post-conseils/chapter-header.php index a17ce98..837bd9d 100644 --- a/template-components/post-conseils/chapter-header.php +++ b/template-components/post-conseils/chapter-header.php @@ -1,15 +1,16 @@ ID, 'thematiques')[0] ?? null; +$thematique = get_the_terms($args['ID'], 'thematiques')[0] ?? null; $thematique_generale = $thematique->parent ? get_term($thematique->parent, 'thematiques') : $thematique; -$thematique_generale_id_fr = apply_filters('wpml_object_id', $thematique_generale->term_id, 'thematiques', TRUE, 'fr'); +$thematique_generale_id_fr = + apply_filters('wpml_object_id', $thematique_generale->term_id, 'thematiques', TRUE, 'fr'); // Récupère la source de l'image par rapport à l'ID FR pour s'assurer de bien synchroniser les images dans les deux langues $thematique_picture = get_field('taxonomy_pictures', "thematiques_" . $thematique_generale_id_fr)['illustration_s'] ?? null; -$lastUpdate = get_the_modified_date('', get_the_ID()); +$lastUpdate = get_the_modified_date('', $args['ID']); -$args = array( +$queryArgs = array( // 'fields' => 'ids', 'post_type' => 'brochures', 'posts_per_page' => 1, @@ -21,10 +22,13 @@ $args = array( ) ) ); -$relatedBrochuresPosts = get_posts($args); + + +$relatedBrochuresPosts = get_posts($queryArgs); $relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null; + ?> @@ -38,16 +42,18 @@ $relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? n -

+

Télécharger la brochure post_title ?> - - - - + $args['ID'], + "modified" => $lastUpdate + )); + ?>