handling superior icon

This commit is contained in:
Antoine M 2023-11-15 16:41:00 +01:00
parent fe74345a40
commit dd3e2d3f79
2 changed files with 18 additions and 8 deletions

View File

@ -5,6 +5,8 @@ $thematiquesTerms = get_terms(array(
'hide_empty' => false, 'hide_empty' => false,
'parent' => 0 'parent' => 0
)); ));
$page_icon = get_field('page_icon', get_queried_object());
?> ?>
<nav class="breadcrumbs_navigation" aria-label="breadcrumbs"> <nav class="breadcrumbs_navigation" aria-label="breadcrumbs">
@ -19,14 +21,18 @@ $thematiquesTerms = get_terms(array(
</nav> </nav>
<section class="archive-page-header"> <section class="archive-page-header">
<h1 class="thematiques-post-viewer__title"><?php echo __("Nos conseils par thématique", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></h1>
<p class="thematiques-post-viewer__description"><?php echo __("Simplifions votre recherche grâce aux questions fréquemment posées !", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></p> <?php if ($page_icon) : ?>
<ul class="thematiques-post-viewer__terms-grid"> <img class="archive-page-header__icon" src="<?php echo $page_icon['url'] ?>" alt="" />
<?php endif; ?>
<h1 class="archive-page-header__title"><?php echo __("Nos conseils par thématique", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></h1>
<p class="archive-page-header__description"><?php echo __("Simplifions votre recherche grâce aux questions fréquemment posées !", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></p>
<ul class="archive-page-header__terms-grid">
<?php foreach ($thematiquesTerms as $thematique) : ?> <?php foreach ($thematiquesTerms as $thematique) : ?>
<?php <?php
// $thematique_icon = get_field('taxonomy_pictures', $thematique->term_id)['icon']; // $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); // $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']; // $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'); $original_term_ID = apply_filters('wpml_object_id', $thematique->term_id, 'thematiques', FALSE, 'fr');

View File

@ -6,6 +6,7 @@ $thematiquesTerms = get_terms(array(
'hide_empty' => false, 'hide_empty' => false,
'parent' => 0 'parent' => 0
)); ));
$page_icon = get_field('page_icon', get_queried_object());
?> ?>
<nav class="breadcrumbs_navigation" aria-label="breadcrumbs"> <nav class="breadcrumbs_navigation" aria-label="breadcrumbs">
@ -19,10 +20,13 @@ $thematiquesTerms = get_terms(array(
</ol> </ol>
</nav> </nav>
<section class="archive-page-header"> <section class="archive-page-header archive-page-header--faq">
<h1 class="thematiques-post-viewer__title"><?php echo __("Les questions par thématique", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></h1> <?php if ($page_icon) : ?>
<p class="thematiques-post-viewer__description"><?php echo __("Simplifions votre recherche grâce aux questions fréquemment posées !", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></p> <img class="archive-page-header__icon" src="<?php echo $page_icon['url'] ?>" alt="" />
<ul class="thematiques-post-viewer__terms-grid"> <?php endif; ?>
<h1 class="archive-page-header__title archive-page-header--faq__title"><?php echo __("Les questions par thématique", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></h1>
<p class="archive-page-header__description"><?php echo __("Simplifions votre recherche grâce aux questions fréquemment posées !", "homegrade-theme__texte-fonctionnel__faq-archive-questions") ?></p>
<ul class="archive-page-header__terms-grid">
<?php foreach ($thematiquesTerms as $thematique) : ?> <?php foreach ($thematiquesTerms as $thematique) : ?>
<?php <?php