<?php
/*
@package kidzoo-lite
  =================
  Gallery post format
  =================
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class( 'kidzoo-format-gallery' ); ?>>

    <div class="entry-content">
        <header class="entry-header">

        <?php if( kidzoo_get_attachment() ): ?>

          <div id="post-gallery-<?php the_ID(); ?>" class="carousel slide kidzoo-carousel-thumb" data-ride="carousel">

            <div class="carousel-inner" role="listbox">

              <?php
                $attachments = kidzoo_get_bs_slides(kidzoo_get_attachment(7));
                foreach ($attachments as $attachment) :
              ?>

                <div class="item <?php echo $attachment['class']; ?> standard-featured background-image" style="background-image: url( <?php echo $attachment['url']; ?> );">

                  <div class="hide next-image-preview" data-image="<?php echo $attachment['next_img']; ?>"></div>
                  <div class="hide prev-image-preview" data-image="<?php echo $attachment['prev_img']; ?>"></div>

                  <div class="entry-excerpt image-caption">
                    <p>
                      <?php echo $attachment['caption']; ?>
                    </p>
                  </div>

                </div>

              <?php endforeach; ?>

            </div> <!-- .carousel-inner -->
            <a class="left carousel-control" href="#post-gallery-<?php the_ID(); ?>" role="button" data-slide="prev">
              <div class="table">
                <div class="table-cell">

                  <div class="preview-container">
                    <span class="thumbnail-container background-image"></span>
                    <span class="fa fa-long-arrow-left" aria-hidden="true"></span>
                    <span class="sr-only"></span>
                  </div><!-- .preview-container -->

                </div><!-- .table-cell -->
              </div><!-- .table -->
            </a>
            <a class="right carousel-control" href="#post-gallery-<?php the_ID(); ?>" role="button" data-slide="next">
              <div class="table">
                <div class="table-cell">

                  <div class="preview-container">
                    <span class="thumbnail-container background-image"></span>
                    <span class="fa fa-long-arrow-right" aria-hidden="true"></span>
                    <span class="sr-only"></span>
                  </div><!-- .preview-container -->

                </div><!-- .table-cell -->
              </div><!-- .table -->
            </a>
          </div>

        <?php endif; ?>

        <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">','</a></h1>' ) ?>

        <div class="entry-meta">
          <?php echo kidzoo_posted_meta(); ?>
        </div>

      </header>

      <div class="entry-excerpt">
        <?php the_excerpt(); ?>
      </div>

      <div class="button-container">
          <a href="<?php the_permalink(); ?>" class="btn-kidzoo"><?php esc_html_e('Continue', 'kidzoo-lite'); ?> <i class="fa fa-long-arrow-right"></i></a>
      </div>

  </div><!-- .entry-content -->
  <footer class="entry-footer">
    <?php echo kidzoo_posted_footer(); ?>
  </footer>

</article>
