85 lines
2.6 KiB
PHP
85 lines
2.6 KiB
PHP
<?php get_header(); ?>
|
|
|
|
<?php
|
|
$current_issue = get_queried_object();
|
|
|
|
$issue_related_articles = new WP_Query(array(
|
|
'post_type' => 'articles',
|
|
'posts_per_page' => 3,
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
'meta_query' => array(
|
|
array(
|
|
'key' => 'related_revue',
|
|
'value' => $current_issue->ID,
|
|
'compare' => '=',
|
|
),
|
|
),
|
|
));
|
|
|
|
$articles = get_field('articles', $current_issue->ID);
|
|
?>
|
|
|
|
|
|
<div class="page--single-revue">
|
|
<?php if (have_posts()) : ?>
|
|
|
|
<?php while (have_posts()) : the_post(); ?>
|
|
<section class="single-revue__header ">
|
|
<div class="single-revue__header__inner ">
|
|
<div class="content">
|
|
<div class="content-meta">
|
|
<span class="content-meta__type content-meta__type--revue">Revue</span>
|
|
</div>
|
|
<h1> <?php the_title(); ?></h1>
|
|
<div class="revue-meta">
|
|
<p class="revue-issue">
|
|
<span class="revue-issue-label revue-meta__label">Numéro</span>
|
|
<span class="revue-issue-number revue-meta__value">25</span>
|
|
</p>
|
|
<div class="revue-date-info">
|
|
<p class="revue-date-label revue-meta__label">Publication</p>
|
|
<time class="revue-publish-date revue-meta__value" datetime="<?php echo get_the_date('Y-m-d'); ?>"><?php echo get_the_date('d F Y'); ?></time>
|
|
</div>
|
|
<div class="revue-date-info">
|
|
<p class="revue-date-label revue-meta__label">Mis à jour</p>
|
|
<time class="revue-update-date revue-meta__value" datetime="<?php echo get_the_modified_date('Y-m-d'); ?>"><?php echo get_the_modified_date('d F Y'); ?></time>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="thumbnail-wrapper">
|
|
<?php the_post_thumbnail('full', ['class' => 'thumbnail']); ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
<?php if ($issue_related_articles->have_posts()) : ?>
|
|
<?php while ($issue_related_articles->have_posts()) : $issue_related_articles->the_post(); ?>
|
|
<?php $terms = get_the_terms($post->ID, 'etiquettes'); ?>
|
|
|
|
<article class="single-revue__articles">
|
|
<h2 class="single-revue__articles__title article-title"> <?php echo get_the_title($article); ?></h2>
|
|
<ul class="single-revue__articles__tags article-tags">
|
|
<?php foreach ($terms as $term) : ?>
|
|
<li class="single-revue__articles__tag article-tag"> <?php echo $term->name; ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
|
|
<p class="single-revue__articles__excerpt"> <?php the_content(); ?></p>
|
|
</article>
|
|
<?php endwhile; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
|
|
<?php endwhile; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php
|
|
get_footer();
|