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; + ?>