carhop__carhop-theme__DEV/template-parts/analyses-etudes/card-analyse-etude.php

42 lines
1.4 KiB
PHP

<?php
$ID = $args['ID'] ?? null;
$types_terms = get_the_terms($ID, 'type');
$type = isset($types_terms[0]) ? $types_terms[0] : null;
$title = get_the_title($ID);
$excerpt = get_the_excerpt($ID);
$link = get_the_permalink($ID);
$image = get_the_post_thumbnail_url($ID);
$date = get_the_date('F Y', $ID);
$author = get_the_author_meta('display_name', get_the_author_meta('ID', $ID));
$author_link = get_the_author_link($ID);
$author_avatar = get_avatar_url(get_the_author_meta('ID', $ID));
$numerotation = get_post_meta($ID, 'post_numerotation', true);
?>
<div class="post-card post-card--analyses-etudes card">
<?php if ($type) : ?>
<div class="content-meta">
<span class="content-meta__type content-meta__type--revue"><?php echo $type->name; ?></span>
<p class="content-meta__revue-issue content-meta__revue-issue--green">
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
<?php echo $numerotation; ?>
</p>
</div>
<?php endif; ?>
<div class="card__inner">
<div class="card__content">
<h3 class="card__title"><?php echo $title; ?></h3>
<div class="card__excerpt"><?php echo $excerpt; ?></div>
</div>
<div class="card__details">
<p class="card__details-text"><?php echo $excerpt; ?></p>
<time datetime="<?php echo $date; ?>" class="card__details-date date"><?php echo $date; ?></time>
</div>
</div>
</div>