<?php
/* Template Name: Liens */
get_header();
?>


<!-- MAIN -->
<section id="main" role="main">
	<div class="wrapper">

		<?php if (have_posts()) : ?>
			<?php while (have_posts()) : the_post(); ?>

				<article>
					<?php the_title('<h1>', '</h1>'); ?>
					<div class="content">
						<?php
						if (have_rows('links')) :
						?>
							<ul class="social_links">
								<?php
								while (have_rows('links')) : the_row();
								?>
									<li class="link">
										<?php if (get_sub_field('links_email')) :  ?>
											<a href="mailto:<?php the_sub_field('links_email'); ?>" class="link__email">
												<span class="link__country"><?php the_sub_field('links_country'); ?></span>

											</a>
										<?php endif; ?>
										<?php if (get_sub_field('links_facebook')) :  ?>
											<a href="<?php the_sub_field('links_facebook'); ?>" class="link__facebook">
												<span class="link__country"><?php the_sub_field('links_country'); ?></span>

											</a>

										<?php endif; ?>
										<?php if (get_sub_field('links_twitter')) :  ?>
											<a href="<?php the_sub_field('links_twitter'); ?>" class="link__twitter">
												<span class="link__country"><?php the_sub_field('links_country'); ?></span>

											</a>

										<?php endif; ?>
										<?php if (get_sub_field('links_instagram')) :  ?>
											<a href="<?php the_sub_field('links_instagram'); ?>" class="link__instagram">
												<span class="link__country"><?php the_sub_field('links_country'); ?></span>

											</a>

										<?php endif; ?>
										<?php if (get_sub_field('links_website')) :  ?>
											<a href="<?php the_sub_field('links_website'); ?>" class="link__website">
												<span class="link__country"><?php the_sub_field('links_country'); ?></span>

											</a>

										<?php endif; ?>

									</li>
								<?php
								endwhile;
								?>
							</ul>
						<?php
						endif;
						?>
					</div>
				</article>

			<?php endwhile; ?>
		<?php endif; ?>

	</div>
</section>

<?php get_footer(); ?>