<?php
$query =  new WP_Query(array(
	'post_type' => 'revues',
	'orderby' => 'date',
	'order' => 'DESC',
	'offset' => 1,
));


?>
<section class="block-revues-precedentes" <?php echo get_block_wrapper_attributes(); ?>>
	<div class="block-revues-precedentes__inner">

		<div class="block-revues-precedentes__header">
			<h2 class="block-title">À découvrir</h2>
			<h3 class="block-subtitle">Lisez nos revues précédentes</h3>
		</div>


		<div class="block-revues-precedentes__slider-content">
			<?php if ($query->have_posts()) : ?>
				<div class="swiper revues-precedentes-swiper">
					<div class="swiper-wrapper">
						<?php while ($query->have_posts()) : $query->the_post(); ?>
							<article class="card-revue swiper-slide">
								<div class="content-meta">
									<span class="content-meta__type content-meta__type--revue">Revue</span>
								</div>
								<div class="card-revue__content">
									<h4 class="card-revue__title title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
									<h5 class="card-revue__edito-title edito-title">Édito</h5>
									<div class="card-revue__excerpt">
										<?php the_excerpt(); ?>
									</div>
								</div>

								<div class="card-revue__issue-thumbnail-wrapper">
									<?php $post_thumbnail_id = get_the_post_thumbnail(get_the_ID(), 'full'); ?>
									<div class="card-revue__issue-thumbnail">
										<?php if ($post_thumbnail_id) : ?>
											<?php echo $post_thumbnail_id; ?>
										<?php endif; ?>
									</div>
									<div class="card-background"></div>
								</div>


							</article>
						<?php endwhile; ?>
					</div>
					<div class="swiper-pagination"></div>
					<div class="swiper-button-next"></div>
					<div class="swiper-button-prev"></div>
				</div>


			<?php endif; ?>
		</div>
</section>