homegrade_theme_production/template-components/posts-components/chapter-header.php
2024-01-17 16:38:35 +01:00

26 lines
1.2 KiB
PHP

<?php
$thematique = $args['thematique'] ?? null;
$thematiqueParent = $args['thematiqueParent'] ?? null;
// $thematique = get_the_terms($args->ID, 'thematiques')[0] ?? null;
$thematique_generale = $args['thematique_generale'];
$thematique_generale_id_fr = apply_filters('wpml_object_id', $thematique_generale->term_id, 'thematiques', TRUE, 'fr');
// Récupère la source de l'image par rapport à l'ID FR pour s'assurer de bien synchroniser les images dans les deux langues
$thematique_picture = get_field('taxonomy_pictures', "thematiques_" . $thematique_generale_id_fr)['illustration_s'] ?? null;
$lastUpdate = get_the_modified_date('', get_the_ID());
?>
<section class="post-chapter-header bg-<?php echo $args['thematiqueColorSlug'] ?>-light">
<div class="post-chapter-header__infos">
<?php if ($args['sub-title']) : ?>
<p class="post-conseils-chapter-header__page-thematic-title <?php echo "text-" . $args['thematiqueColorSlug'] ?>"><?php echo $args['sub-title'] ?></p>
<?php endif; ?>
<h1 class="post-chapter-header__page-title"><?php echo $args['title'] ?></h1>
</div>
<img class="post-chapter-header__page-thematic-cover " src="<?php echo $thematique_picture['url'] ?>" alt="">
</section>