36 lines
1.5 KiB
PHP
36 lines
1.5 KiB
PHP
<?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>
|