<?php
/**
 * aktivity single page
 *
 */
inoby_enqueue_parted_style("aktivity", "post_types");
inoby_enqueue_parted_script("aktivity", "post_types");

$interesting = rwmb_meta("activities_interesting");
$gallery = rwmb_meta("activities_gallery");
get_header();

function gallery($gallery){
  foreach($gallery as $images){
    $imgs_id[] = $images['ID']; 
  }
  // return $imgs_id;
  return $imgs_id;
}
?>

<main id="primary" class="site-main">
  <section class="header">
    <div class="container">
      <div class="row">
        <div class="col-12">
          <div class="title-wrap">
            <h1 class="underlined"><?php the_title(); ?></h1>
          </div>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <?php the_content(); ?>
    <?php
      if($interesting){
        echo '<div class="interesting">';
        foreach($interesting as $fact){
          echo '<span>'.$fact.'</span>';
        }
        echo '</div>';
      }
    ?>
  </section>

  <?php
    if($gallery){
      rwmb_meta_render_block("inoby-slider-gallery", [
        "heading" => __('Galéria','podoblazom'),
        "images" => gallery($gallery),
        "settings" => ['has_arrows' => true, 'has_lightbox' => true],
      ],
      "activity-single-gallery", true); 
    }
  ?>
</main>

<?php get_footer();