ADD Implement single revue template with dynamic article retrieval and structured layout for improved content presentation.
This commit is contained in:
parent
93f08fe4de
commit
2f5960df69
127
single-revues.php
Normal file
127
single-revues.php
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
<?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);
|
||||
|
||||
write_log($articles);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<!-- <section class="block-dernieres-dynamiques">
|
||||
<div class="block-dernieres-dynamiques__inner">
|
||||
|
||||
|
||||
|
||||
<div class="content-meta">
|
||||
<span class="content-meta__type content-meta__type--revue">Revue</span>
|
||||
</div>
|
||||
|
||||
<div class="block-dernieres-dynamiques__issue-content-wrapper">
|
||||
<div class="block-dernieres-dynamiques__issue-content">
|
||||
|
||||
<h3 class="block-dernieres-dynamiques__issue-title">
|
||||
<?php echo $last_issue->post_title; ?>
|
||||
</h3>
|
||||
<h4 class="block-dernieres-dynamiques__issue-description-title">Édito</h4>
|
||||
<p class="block-dernieres-dynamiques__issue-description">
|
||||
<?php echo $last_issue->post_excerpt; ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="block-dernieres-dynamiques__issue-thumbnail-wrapper">
|
||||
<div class="block-dernieres-dynamiques__issue-thumbnail">
|
||||
<?php echo get_the_post_thumbnail($last_issue->ID, 'full'); ?>
|
||||
</div>
|
||||
<div class="card-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section> -->
|
||||
|
||||
<?php endwhile; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
Loading…
Reference in New Issue
Block a user