From 1bd9842c532bb4ab3d4a8fe53683919a1b706ee3 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 30 Nov 2023 15:33:07 +0100 Subject: [PATCH] refactoring parent thematiques urls --- template-archive-conseils.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/template-archive-conseils.php b/template-archive-conseils.php index 77a5718..248ab59 100644 --- a/template-archive-conseils.php +++ b/template-archive-conseils.php @@ -37,11 +37,7 @@ $page_icon = get_field('page_icon', get_queried_object()); || $thematique->slug === "au-quotidien" || $thematique->slug === "dagelijks" ) continue; - - // $thematique_icon = get_field('taxonomy_pictures', $thematique->term_id)['icon']; - // $translated_term_id = icl_object_id($thematique->term_id, $thematique->taxonomy, true, ICL_LANGUAGE_CODE); - // $thematique_icon = get_field('taxonomy_pictures', $thematique->taxonomy . '_' . $translated_term_id)['icon']; - + $original_term_ID = apply_filters('wpml_object_id', $thematique->term_id, 'thematiques', FALSE, 'fr'); $thematique_icon = get_field('taxonomy_pictures', $thematique->taxonomy . '_' . $original_term_ID)['icon']; $termSlug = getThematiqueFamilySlug($thematique->slug); @@ -54,15 +50,17 @@ $page_icon = get_field('page_icon', get_queried_object()); 'taxonomy' => 'thematiques', 'field' => 'term_id', 'terms' => $thematique->term_id, + 'include_children' => false ) ) ); - $relatedPostConseil = get_posts($args); - + + $relatedThematiqueConseilsQuery = new WP_Query($args); + $relatedPostConseil = $relatedThematiqueConseilsQuery->posts[0] ?? null; ?>
  • - +

    Question name ?>