87 lines
2.9 KiB
PHP
87 lines
2.9 KiB
PHP
<?php /* Template Name: Publications | Archive */
|
|
get_header();
|
|
?>
|
|
<div class="template-archives template-archives--publications">
|
|
<nav class="breadcrumbs_navigation" aria-label="breadcrumbs">
|
|
<ol>
|
|
<li><a href="<?php echo home_url() ?>">Home</a></li>
|
|
<li><a href="<?php echo get_post_type_archive_link('brochures') ?>" aria-current='location'>Publications</a></li>
|
|
</ol>
|
|
</nav>
|
|
|
|
|
|
<section class="archive-page-header">
|
|
<h1 class="archive-page-header__title"><?php echo __("Nos publications", "homegrade-theme__texte-fonctionnel__publications-archive-brochures") ?></h1>
|
|
<p class="archive-page-header__description"> <?php echo __("Découvrez toutes nos publications et outils en ligne", "homegrade-theme__texte-fonctionnel__publications-archive-brochures") ?>
|
|
</p>
|
|
<?php get_search_form(); ?>
|
|
|
|
</section>
|
|
|
|
|
|
<section class="brochures-archives">
|
|
<div class="section_titling section_titling--left">
|
|
<h2 class="section_titling__title"><?php echo __("Nos Brochures thématiques", "homegrade-theme__texte-fonctionnel__publications-archive-brochures") ?></h2>
|
|
<p class="section_titling__subtitle">Curabitur eleifend neque eu erat lacinia tincidunt</p>
|
|
</div>
|
|
|
|
|
|
<?php
|
|
$args = array(
|
|
'post_type' => 'brochures',
|
|
'posts_per_page' => -1,
|
|
'post_status' => 'publish',
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
);
|
|
$brochures = new WP_Query($args);
|
|
|
|
|
|
?>
|
|
<ul class="brochures-grid">
|
|
<?php if ($brochures->have_posts()) : ?>
|
|
<?php while ($brochures->have_posts()) : $brochures->the_post(); ?>
|
|
<?php
|
|
$brochureCover = get_field('brochure_cover', get_the_ID());
|
|
$brochurePdf = get_field('brochure_pdf', get_the_ID());
|
|
$brochureEdition = get_field('brochure_edition', get_the_ID());
|
|
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0];
|
|
$rootThematic = getParentThematique($thematique);
|
|
|
|
?>
|
|
<?php if ($brochurePdf) : ?>
|
|
<li class="brochures-grid__row">
|
|
<?php if ($brochureCover) : ?>
|
|
<img class="brochures-grid__cover" src="<?php echo $brochureCover['sizes']['medium'] ?>" />
|
|
<?php endif; ?>
|
|
<h2 class="brochures-grid__title"><?php echo $brochurePdf['title'] ?></h2>
|
|
<p class="brochures-grid__thematique"><?php echo $rootThematic->name ?></p>
|
|
<?php if ($brochureEdition) : ?>
|
|
<p class="brochures-grid__edition"><?php echo $brochureEdition ?></p>
|
|
<?php endif; ?>
|
|
<div class="brochures-grid__button">
|
|
<a href="<?php echo $brochurePdf->url ?>" class=" cta cta--secondary cta--button" href="#" target="_blank"><?php echo __("Consulter le pdf", "homegrade-theme__texte-fonctionnel__publications-archive-brochures") ?></a>
|
|
</div>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php endwhile ?>
|
|
<?php endif; ?>
|
|
|
|
|
|
</ul>
|
|
<?php wp_reset_postdata(); ?>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
get_footer();
|