47 lines
1.4 KiB
PHP
47 lines
1.4 KiB
PHP
<?php
|
|
$articleID = $args['ID'];
|
|
$isSwiperSlide = $args['isSwiperSlide'] ?? false;
|
|
$showCover = $args['showCover'] ?? false;
|
|
$cover = get_the_post_thumbnail_url($articleID);
|
|
?>
|
|
|
|
<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">
|
|
<a href="<?php echo add_query_arg('etiquette', $tag->slug, get_post_type_archive_link('articles')); ?>">
|
|
<?php echo esc_html($term->name); ?>
|
|
</a>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
|
|
</ul>
|
|
|
|
<?php if ($showCover && isset($cover) && $cover) : ?>
|
|
<div class="article-card__cover">
|
|
<img src="<?php echo $cover; ?>" alt="<?php echo get_the_title($articleID); ?>">
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php get_template_part('template-parts/components/cta--go', null, array(
|
|
'url' => get_the_permalink($articleID),
|
|
'label' => 'Lire la revue',
|
|
'target' => '_self',
|
|
)); ?>
|
|
|
|
|
|
</div>
|