FEATURE Intoducing component to be reused

This commit is contained in:
Antoine M 2025-09-04 17:05:09 +02:00
parent ecfcc43211
commit 9d34e1b30d

View File

@ -0,0 +1,35 @@
<?php
$articleID = $args['ID'];
$isSwiperSlide = $args['isSwiperSlide'];
?>
<div class="article-card <?php echo $isSwiperSlide ? 'swiper-slide' : ''; ?>">
<div class="content-meta">
<span class="content-meta__type content-meta__type--article">Article</span>
</div>
<a href="<?php echo get_the_permalink($articleID); ?>" class="article-card__link">
<h4 class="article-card__title"><?php echo get_the_title($articleID); ?></h4>
</a>
<ul class="article-card__tags">
<?php
$terms = get_the_terms($articleID, 'etiquettes');
if ($terms): ?>
<?php foreach ($terms as $term): ?>
<li class="article-card__tag article-tag"><?php echo esc_html($term->name); ?></li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<?php get_template_part('template-parts/components/cta--go', null, array(
'url' => get_the_permalink($articleID),
'label' => 'Lire la revue lol',
'target' => '_self',
)); ?>
</div>