homegrade_theme_production/template-components/cards/card-news.php

34 lines
1.3 KiB
PHP

<?php
$post_ID = $args['post_ID'];
$card_variant = $args['card_variant'];
$post_thumbnail = $args['post_thumbnail'];
$post_title = $args['post_title'];
$news_type = $args['news_type'] ?? null;
$thematique = $args['thematique'] ?? null;
$mainThematique = getMainThematique($thematique) ?? null;
?>
<div class="card-news <?php echo $card_variant ? 'card-news--' . $card_variant : '' ?> ">
<?php echo $post_thumbnail ?>
<div class="card-news__inner">
<div class="card-news__heading">
<h3 class="card-news__title"><?php echo $post_title ?></h3>
<?php if ($news_type) : ?>
<p class="card-news__tag"><?php echo $news_type[0]->name ?></p>
<?php endif; ?>
<?php if ($thematique) : ?>
<p class="card-news__thematique-tag card-news__thematique-tag--<?php echo $mainThematique->slug ?>"><?php echo $thematique->name ?></p>
<?php endif; ?>
</div>
<a href="<?php echo get_the_permalink($post_ID) ?>" class="cta cta--read-more cta--with-arrow-button cta--streched ">
<!-- cta-read-more -->
<span><?php echo __("Lire l'article", 'homegrade-theme__texte-fonctionnel') ?></span>
<span class="sr-only"><?php echo $post_title ?></span>
<img class="cta_arrow_button" src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/arrow-right-circle.svg' alt=''>
</a>
</div>
</div>