From 13225dbc41aaefd36fa71f8c4266ca1edef1c11b Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 30 Nov 2023 18:05:43 +0100 Subject: [PATCH] Renaming and adapting cards conseils thematiques --- resources/css/app.css | 2 +- ...tique.css => card-conseils-thematique.css} | 0 ...tique.php => card-conseils-thematique.php} | 19 +++++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) rename template-components/cards/{card-thematique.css => card-conseils-thematique.css} (100%) rename template-components/cards/{card-thematique.php => card-conseils-thematique.php} (71%) diff --git a/resources/css/app.css b/resources/css/app.css index 1746931..936d108 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -31,7 +31,7 @@ @import '../../template-components/cards/card-news.css'; @import '../../template-components/cards/card-frequent_question.css'; -@import '../../template-components/cards/card-thematique.css'; +@import '../../template-components/cards/card-conseils-thematique.css'; @import '../../template-components/cards/page-card.css'; @import '../../template-components/post-conseils/chapter-header.css'; @import '../../template-components/post-questions/chapter-header.css'; diff --git a/template-components/cards/card-thematique.css b/template-components/cards/card-conseils-thematique.css similarity index 100% rename from template-components/cards/card-thematique.css rename to template-components/cards/card-conseils-thematique.css diff --git a/template-components/cards/card-thematique.php b/template-components/cards/card-conseils-thematique.php similarity index 71% rename from template-components/cards/card-thematique.php rename to template-components/cards/card-conseils-thematique.php index 1351ca7..366d37c 100644 --- a/template-components/cards/card-thematique.php +++ b/template-components/cards/card-conseils-thematique.php @@ -2,10 +2,25 @@ // $thematique est un post type object term de la taxonomie thematiques $thematique = $args['thematique']; - $taxonomy_picture = get_field('taxonomy_pictures', $thematique) ?? null; $color = getThematiqueFamilySlug($thematique->slug); +$args = array( + 'posts_per_page' => 1, + 'post_type' => 'conseils', + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'term_id', + 'terms' => $thematique->term_id, + 'include_children' => false + ) + ) +); + +$relatedThematiqueConseilsQuery = new WP_Query($args); +$relatedPostConseil = $relatedThematiqueConseilsQuery->posts[0] ?? null; + ?>
@@ -14,7 +29,7 @@ $color = getThematiqueFamilySlug($thematique->slug);

name ?>

description ?>

- + slug ?>