FEATURE Introducing component
This commit is contained in:
parent
4be0368ea4
commit
342187cd5e
26
template-parts/cards/communique-presse-card.php
Normal file
26
template-parts/cards/communique-presse-card.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
$communique_id = $args['communique_id'];
|
||||
$communique_file = get_field(selector: 'file', post_id: $communique_id);
|
||||
$communique_file_url = $communique_file['url'];
|
||||
$communique_file_size = size_format($communique_file['filesize']);
|
||||
$communique_file_type = $communique_file['subtype'];
|
||||
?>
|
||||
|
||||
<div class="communique-card">
|
||||
<?php get_template_part('template-parts/components/content-meta', null, array(
|
||||
'current_post_type' => 'communique-presse',
|
||||
'current_post_id' => $communique_id
|
||||
)); ?>
|
||||
<h3><?php echo get_the_title($communique_id); ?></h3>
|
||||
<div class="communique-card__file-infos">
|
||||
<time datetime="<?php echo get_the_date('Y-m-d', $communique_id); ?>"><?php echo get_the_date('d F Y', $communique_id); ?></time>
|
||||
<?php if ($communique_file) : ?>
|
||||
<span>|</span>
|
||||
<span class="communique-card__file-type"><?php echo $communique_file_type; ?></span>
|
||||
<span class="communique-card__file-size">(<?php echo $communique_file_size; ?>)</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <a href="<?php echo get_permalink($communique_id); ?>" class="button">Voir le communiqué</a> -->
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user