<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Xarxaprod_theme
 */

?>
<!-- template-parts content-xarxaprod-associat-php -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

	<header class="entry-header">
		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
	</header><!-- .entry-header -->

	<main class="entry-content">

		<?php
		the_content(
			sprintf(
				wp_kses(
					/* translators: %s: Name of current post. Only visible to screen readers */
					__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'xarxaprod' ),
					array(
						'span' => array(
							'class' => array(),
						),
					)
				),
				wp_kses_post( get_the_title() )
			)
		);

		wp_link_pages(
			array(
				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'xarxaprod' ),
				'after'  => '</div>',
			)
		);
		?>
	</main><!-- .entry-content -->

	<section class="xarxaprod-associat-info-contact-fields">

    <?php if( get_field('xxp_associat_address') ): ?>
	  <div class="xarxaprod-associat-info-field">
      <p class="xarxaprod-associat-address"><?php the_field('xxp_associater_address'); ?></p>
		</div>
    <?php endif; ?>

	  <?php if( get_field('xxp_associat_mail') ): ?>
	  <div class="xarxaprod-associat-info-field">
	  	<h6>mail:</h6>
      <p class="xarxaprod-associat-mail"><a href="mailto:<?php the_field('xxp_associat_mail'); ?>"><?php the_field('xxp_associat_mail'); ?></a></p>
	  </div>
    <?php endif; ?>

 	  <?php if( get_field('xxp_associat_web') ): ?>
	  <div class="xarxaprod-associat-info-field">
	  	<h6>web:</h6>
			<p><a href="<?php the_field('xxp_associat_web'); ?>" class=""><?php the_field('xxp_associat_web') ;?></a></p>
		</div>
		<?php endif; ?>
		
	  <?php if( get_field('xxp_associat_contact_tel') ): ?>
	  <div class="xarxaprod-associat-info-field">
      <p class="xarxaprod-associat-contact-tel"><?php the_field('xxp_associat_contact_tel'); ?></p>
	  </div>
    <?php endif; ?>

	</section>

	<section class="xarxaprod-associat-info-fields">

	  <div class="xarxaprod-associat-info-field">
      <h6>Serveis</h6>
	  	<?php get_template_part( 'template-parts/section', 'list-checkbox', array('iterate_field' => 'xxp_associat_service') ); ?>
		</div>

	</section>

	<section class="xarxaprod-associat-logo-fields">

	  <?php if( get_field('xxp_associat_logo') ): ?>
	  <figure class="xarxaprod-associat-logo-field">
      <img class="xarxaprod-associat-logo" src="<?php the_field('xxp_associat_logo'); ?>" />
		</figure>
    <?php endif; ?>

	  <?php if( get_field('xxp_associat_osm_link') ): ?>
		<div class="xarxaprod-associat-osm-link">
      <h6 class="">Localizatcio:</h6><p> <a href="<?php the_field('xxp_associat_osm_link'); ?>"><?php the_field('xxp_associat_osm_link'); ?></a></p>
	  </div>
    <?php endif; ?>

	  <?php if( get_field('xxp_associat_osm_link') ): ?>
		<div class="xarxaprod-associat-osm-link">
			<h6 class="">Mapa:</h6>
      <figure><?php the_field('xxp_associat_osm_map'); ?></figure>
	  </div>
    <?php endif; ?>
	</section>

	<footer class="entry-footer">
		<?php xarxaprod_entry_footer(); ?>
	</footer><!-- .entry-footer -->
</article><!-- #post-<?php the_ID(); ?> -->
