switching function call from getParentThematique to getMainThematique

This commit is contained in:
Antoine M 2024-05-27 11:10:46 +02:00
parent 7ec223315a
commit daa9dcae9b
8 changed files with 9 additions and 9 deletions

View File

@ -45,7 +45,7 @@
<?php
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0];
$thematiqueParent = getParentThematique($thematique);
$thematiqueParent = getMainThematique($thematique);
$thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug);
?>

View File

@ -279,7 +279,7 @@ function wpdocs_admin_classes($classes)
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
if (!$thematique) return $classes;
$thematiqueParent = getParentThematique($thematique);
$thematiqueParent = getMainThematique($thematique);
$thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug);
$postType = get_post_type($post->ID) ?? null;

View File

@ -8,7 +8,7 @@ get_header();
while (have_posts()) :
the_post();
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0];
$thematiqueParent = getParentThematique($thematique);
$thematiqueParent = getMainThematique($thematique);
$thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug);
?>

View File

@ -12,7 +12,7 @@ $brochuresPosts = $args['brochuresPosts'];
$brochureCover = $brochurePdf['ID'] ? get_field('brochure_cover_image', $brochurePdf['ID']) : null;
$brochureEdition = get_field('brochure_edition', get_the_id()) ?? null;
$thematique = get_the_terms(get_the_id(), 'thematiques')[0] ?? null;
$rootThematic = getParentThematique($thematique) ?? null;
$rootThematic = getMainThematique($thematique) ?? null;
?>
<li class="publications-grid__row">

View File

@ -11,7 +11,7 @@ $fichesInfosPosts = $args['fichesInfosPosts'];
$thematiques = get_the_terms(get_the_ID(), 'thematiques');
$mainThematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
$rootThematic = getParentThematique($mainThematique) ?? null;
$rootThematic = getMainThematique($mainThematique) ?? null;
$rootThematicIcon = get_field('taxonomy_pictures', "thematiques_" . $rootThematic->term_id)['icon'] ?? null;
@ -27,7 +27,7 @@ $fichesInfosPosts = $args['fichesInfosPosts'];
<?php foreach ($thematiques as $thematique) : ?>
<?php
$rootThematic = getParentThematique($thematique) ?? null;
$rootThematic = getMainThematique($thematique) ?? null;
$rootThematicIcon = get_field('taxonomy_pictures', "thematiques_" . $rootThematic->term_id)['icon'] ?? null;
?>
<p class="publications-grid__thematique thematique-tag thematique-tag--<?php echo $rootThematic->slug ?>"><?php echo $rootThematic->name ?></p>

View File

@ -5,7 +5,7 @@ $videosWebinairesPosts = $args['videosWebinairesPosts'];
<?php if ($videosWebinairesPosts->have_posts()) : while ($videosWebinairesPosts->have_posts()) : $videosWebinairesPosts->the_post(); ?>
<?php
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
$mainThematique = getParentThematique($thematique) ?? null;
$mainThematique = getMainThematique($thematique) ?? null;
$publicationDate = get_field("video_publication_date", get_the_ID());
$webinaireUrl = get_field("url", get_the_ID());

View File

@ -92,7 +92,7 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
<?php if ($item->type === "post_type" && $item->type_label === "Conseil") : ?>
<?php
$postThematique = get_the_terms($item->object_id, "thematiques")[0];
$postParentThematique = getParentThematique($postThematique);
$postParentThematique = getMainThematique($postThematique);
$thematiqueCover = get_field('taxonomy_pictures', "thematiques_" . $postParentThematique->term_id);
$thematiqueColorslug = getThematiqueFamilySlug($postThematique->slug);
?>

View File

@ -104,7 +104,7 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
<?php if ($item->type === "post_type" && $item->type_label === "Conseil") : ?>
<?php
$postThematique = get_the_terms($item->object_id, "thematiques")[0];
$postParentThematique = getParentThematique($postThematique);
$postParentThematique = getMainThematique($postThematique);
$thematiqueCover = get_field('taxonomy_pictures', "thematiques_" . $postParentThematique->term_id);
$thematiqueColorslug = getThematiqueFamilySlug($postThematique->slug);
?>