<?php if( have_rows('slider') ): ?>
<section class="home-section home-slider">
	<ul class="slides">
	<?php while( have_rows('slider') ): the_row();
		// vars
		$image = get_sub_field('image');
		$image_mobile = get_sub_field('image_mobile');
		$content = get_sub_field('testo');
		$link = get_sub_field('link');
		?>
		<li class="slide">
			<?php if($image): ?>
				<img class="bg-slide" src="<?php echo $image['sizes']['full_hd']; ?>"	alt="<?= $content ?>" title="<?= $content ?>" longdesc="<?= $content ?>"/>
			<?php endif;?>
			<?php if($image_mobile): ?>
				<img class="bg-slide mobile" src="<?php echo $image_mobile['sizes']['full_hd']; ?>"	alt="<?= $content ?>" title="<?= $content ?>" longdesc="<?= $content ?>"/>
			<?php endif;?>
		  <?php echo '<div class="slide-title">'.$content.'</div>'; ?>
      <?php if( $link ): ?>
        <a class="btn btn-primary boxed" href="<?php echo $link['url']; ?>" target="<?php echo $link['target']; ?>">
					<span>
						<?php echo $link['title']; ?>
					</span>
        </a>
      <?php endif; ?>
		</li>
	<?php endwhile; ?>
	</ul>
</section>
<?php endif; ?>
