From 19073c17bfd5f0e6c4eedae2f6e1b65591a784bd Mon Sep 17 00:00:00 2001 From: Antoine M Date: Mon, 27 Nov 2023 16:25:53 +0100 Subject: [PATCH] addintg mention to related conseil apge --- taxonomy-thematiques.php | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/taxonomy-thematiques.php b/taxonomy-thematiques.php index 24eaab4..9460f37 100644 --- a/taxonomy-thematiques.php +++ b/taxonomy-thematiques.php @@ -101,7 +101,41 @@ $relatedTaxQuestions = new WP_Query($query_args); have_posts()) : while ($relatedTaxQuestions->have_posts()) : $relatedTaxQuestions->the_post(); ?> + 'conseils', + 'posts_per_page' => 1, + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'term_id', + 'terms' => $questionCurrentSubthematique->term_id, + ) + ) + )); + $relatedFichesConseilsThematiqueQuery = new WP_Query(array( + 'post_type' => 'conseils', + 'posts_per_page' => 1, + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'term_id', + 'terms' => $mainThematique->term_id, + ) + ) + )); + $relatedFicheConseil = $relatedFichesConseilsSubThematiqueQuery->posts[0] ?? $relatedFichesConseilsThematiqueQuery->posts[0] ?? null; + + // $test = $relatedSubThematiqueQuery->posts[0] ?? + echo '
';
+				// print_r($questionCurrentSubthematique);
+				// print_r($relatedFichesConseilsSubThematiqueQuery->posts[0]->ID);
+				// print_r($relatedSubThematiqueConseil->posts[0]->ID);
+				echo '
'; + + ?>
@@ -111,6 +145,14 @@ $relatedTaxQuestions = new WP_Query($query_args);
+ + +