carhop__carhop-theme__DEV/archive-analyses-etudes.php

107 lines
3.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php get_header(); ?>
<main id="content" class="site-content flex-grow">
<?php get_template_part('template-parts/page-header', null, array(
'title' => 'Analyses et études',
'subtitle' => 'Accédez à nos recherches et publications thématiques',
'description' => 'Le CARHOP produit des analyses et des études ancrées dans lhistoire sociale, en lien étroit avec les réalités du monde du travail et des mouvements sociaux. Ces productions visent à éclairer lactualité par une lecture historique, critique et accessible.',
'cover' => array(
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-analyses-etudes-cover.svg',
'alt' => 'Revues'
),
'has_overlap' => true,
'background_style' => 'sliced',
'cta' => array(
'title' => __('Trouver une publication', 'carhop'),
'url' => '#prochaines-publications',
)
)); ?>
<div class="latest-parutions">
<h2 class="latest-parutions__title title-small">Dernière parution</h2>
<?php
$latest_analyse = get_posts(array(
'posts_per_page' => 1, // Number of recent posts thumbnails to display
'post_status' => 'publish', // Show only the published posts
'post_type' => 'analyses-etudes',
'orderby' => 'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'analyse',
),
),
));
$latest_etude = get_posts(array(
'posts_per_page' => 1, // Number of recent posts thumbnails to display
'post_status' => 'publish', // Show only the published posts
'post_type' => 'analyses-etudes',
'orderby' => 'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'etude',
),
),
));
$recent_posts = array_merge($latest_analyse, $latest_etude);
?>
<?php foreach ($recent_posts as $post) : ?>
<?php
$type = get_the_terms($post->ID, 'type');
?>
<div class="post-card post-card--analyses-etudes">
<?php if (is_array($type) && !empty($type) && isset($type[0]->name)) : ?>
<div class="latest-parution__item">
<div class="content-meta">
<span class="content-meta__type content-meta__type--revue"><?php echo $type[0]->name; ?></span>
<p class="content-meta__revue-issue content-meta__revue-issue--green">
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
28
</p>
</div>
<?php endif; ?>
<a href="<?php echo get_the_permalink($post->ID); ?>">
<?php echo get_the_post_thumbnail($post->ID, 'medium'); ?>
<h3><?php echo get_the_title($post->ID); ?></h3>
</a>
</div>
</div>
<?php endforeach; ?>
</div>
<!-- #### ANALYSES ET ETUDES POST GRID #### -->
<?php get_template_part('template-parts/analyses-etudes/analyses-etudes-grid'); ?>
<!-- #### SOUTENIR #### -->
<?php
$composition_id = 988;
$soutenir_content = get_post_field('post_content', $composition_id);
if ($soutenir_content) {
echo do_blocks($soutenir_content);
}
?>
<!-- #### INFOLETTRE #### -->
<?php
$composition_id = 992;
$_infolettre_content = get_post_field('post_content', $composition_id);
if ($_infolettre_content) {
echo do_blocks($_infolettre_content);
}
?>
</main>
<?php
get_footer();