<?php
// ici on récupère les revues conseillées
$featured_revues = get_field('featured_revues', 'option');


?>
<section <?php echo get_block_wrapper_attributes(array('class' => 'wp-block-dynamiques-blocks-nos-recommandations')); ?>>
	<div class="inner">

		<div class="block-heading">

			<p class="block-heading__subtitle">à découvrir</p>
			<h2 class="block-heading__title">
				<span> Nos recommandations</span>
			</h2>
			<a href="<?php echo get_post_type_archive_link('revues'); ?>" class="header-link">
				<span>Découvrir toutes nos revues</span>
				<?php
				$svg_path = get_template_directory() . '/resources/img/carhop-fleche-lien-externe-full.svg';
				if (file_exists($svg_path)) {
					echo file_get_contents($svg_path);
				}
				?>
			</a>
		</div>
		<div class="recommandations-grid">
			<?php foreach ($featured_revues as $revue) : ?>
				<?php get_template_part('template-parts/revues/revue-recommandation-card', '', array(
					'ID' => $revue->ID,
					'title' => $revue->post_title
				)); ?>
			<?php endforeach; ?>
		</div>
	</div>



</section>