carhop__dynamiques-theme__P.../single-revues.php
Nonimart c0d422cfa1
All checks were successful
continuous-integration/drone/push Build is passing
REFACTORING Nettoyage et réorganisation du code dans single-revues.php
2025-06-12 08:55:23 +02:00

109 lines
2.8 KiB
PHP

<?php get_header(); ?>
<?php
$current_issue = get_queried_object();
$issue_related_articles = get_field('articles', $current_issue->ID);
$articles = get_field('articles', $current_issue->ID);
?>
<div class="page--single-revue" data-revue-id="<?php echo get_the_ID(); ?>">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('template-parts/revues/revue-header'); ?>
<div class="content-wrapper">
<div class="sidebar">
<div class="search-field">
<input type="text" placeholder="Rechercher">
</div>
<?php
$tags = get_terms(array(
'taxonomy' => 'etiquettes',
));
?>
<?php if ($tags) : ?>
<div class="tags">
<h3 class="tags__title">Tags</h3>
<ul class="tags-list">
<?php foreach ($tags as $tag) : ?>
<li>
<a class="article-tag" href="<?php echo get_term_link($tag); ?>"><?php echo $tag->name; ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>
<div class="content-area">
<div class="authors">
<!-- <button class="authors-button">get Auteurs</button> -->
<div class="authors-list">
</div>
</div>
<details class="edito" open="true">
<summary>
<h2 class="edito__title">
Edito
</h2>
<div class="open-close-icon">
<img src="https://homegrade.brussels/wp-content/themes/Deligraph_Homegrade/resources/img/graphic-assets/chevron_down.svg" class="open-close-cta" alt="">
</div>
</summary>
<div class="edito__content-wrapper">
<div class="edito__content">
<?php the_excerpt(); ?>
<div class="edito__cta">
<button class="cta cta--primary">Bonne Lecture</button>
</div>
</div>
</div>
</details>
<section class="table-matieres">
<h2 class="table-matieres__title">Table des matières</h2>
<ul class="post-grid__list article-grid__list">
<?php foreach ($issue_related_articles as $article) : ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
'date' => $article->post_date,
'image' => get_the_post_thumbnail_url($article->ID),
'link' => get_the_permalink($article->ID),
'ID' => $article->ID
)); ?>
<?php endforeach; ?>
</ul>
</section>
</div>
</div>
<!-- #### EXPLORE TAGS #### -->
<?php get_template_part('template-parts/components/explore-tags'); ?>
<!-- #### INFOLETTRE #### -->
<?php get_template_part('template-parts/components/subscribe-infolettre'); ?>
</div>
</div>
</article>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php
get_footer();