ldc-groupe/content/themes/ldc/partials/list-item.php
2020-08-21 14:55:47 +02:00

36 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
$tags = get_the_tags($post->ID);
?>
<div class="posts-list__item list-item">
<div class="list-item__image image-border-wrap image-borders">
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail(); ?>
<?php else : ?>
<img src="/content/themes/ldc/assets/images/default.jpg" alt="no image" />
<?php endif; ?>
<?php
$borders = array();
$borders['desktop']['bottom'] = 1;
$borders['mobile']['bottom'] = 1;
set_query_var('borders', $borders);
get_template_part('partials/borders');
?>
</div>
<div class="list-item__description description">
<?php if(!empty($tags)) : ?>
<div class="list-item__tags tags">
<div class="single-news__tag tag tag_<?php echo $tags[0]->slug; ?>">
<?php foreach ($tags as $k => $tag): ?>
<?php if ($k !== 0): ?>, <?php endif; ?><?php echo ucfirst($tag->name); ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<div class="list-item__title posts-list__item-title subtitle"><?php the_title(); ?></div>
<div class="list-item__date date date_<?php echo $tags[0]->slug; ?>"><?= get_field('date', $post->ID); ?></div>
<div class="list-item__text ellipsis description"><?php echo get_the_excerpt(); ?></div>
<a class="list-item__readmore" href="<?php the_permalink(); ?>" title="Lire l’article">Lire l’article</a>
</div>
</div>