<?php echo $header; ?>
<div class="container isl-iblogs iblogs-post <?php echo $css_class; ?> th-isl-<?php echo $theme; ?> <?php echo $theme == 'journal2' ? 'j-container' : ''; ?>" <?php echo $theme == 'journal2' ? 'id="container"' : ''; ?>>
  <ul class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
      <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
    <?php } ?>
  </ul>

  <div class="row">
    <?php echo $column_left; ?>

    <?php if ($column_left && $column_right) { ?>
      <?php $class = 'col-sm-6'?>
    <?php } elseif ($column_left || $column_right) { ?>
      <?php $class = 'col-sm-9'?>
    <?php } else { ?>
      <?php $class = 'col-sm-12'?>
    <?php }?>

    <div id="content" class="<?php echo $class; ?>">
      <?php echo $content_top; ?>

      <div class="iblogs-content">
        <article itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
          <h1 itemprop="headline" class="page-title <?php echo $theme == 'journal2' ? 'heading-title' : ''; ?>"><?php echo $heading_title; ?></h1>
          <div class="post-meta"><?php echo $info_format; ?></div>

          <meta itemprop="mainEntityOfPage" content="<?php echo $post['canonical']; ?>">
          <meta itemprop="description" content="<?php echo $post['excerpt']; ?>">
          <meta itemprop="dateModified" content="<?php echo $ogp['dateModified']; ?>">
          <span itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
            <meta itemprop="name" content="<?php echo $ogp['publisher']; ?>">
            <span itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
              <meta itemprop="url" content="<?php echo $ogp['publisher_logo']; ?>">
            </span>
          </span>
          <span class="post-main-image" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
            <meta itemprop="url" content="<?php echo $main_image; ?>">
            <meta itemprop="width" content="<?php echo $post_view['image_width']; ?>">
            <meta itemprop="height" content="<?php echo $post_view['image_height']; ?>">
          </span>

          <?php if ($show_main_image) { ?>
              <img src="<?php echo $main_image; ?>" alt="<?php echo $heading_title; ?>" class="img-responsive">
          <?php } ?>

          <div itemprop="articleBody">
            <?php echo $post_content; ?>
          </div>

          <?php if ($post_view['addthis']) { ?>
            <div class="iblogs-share">
              <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                <a class="addthis_button_preferred_1"></a>
                <a class="addthis_button_preferred_2"></a>
                <a class="addthis_button_preferred_3"></a>
                <a class="addthis_button_preferred_4"></a>
                <a class="addthis_button_compact"></a>
              </div>
              <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js"></script>
            </div>
          <?php } ?>

          <?php if ($post_tags) { ?>
            <div class="iblogs-tags">
              <?php echo $text_tags; ?> <span itemprop="keywords"><?php echo $post_tags; ?></span>
            </div>
          <?php } ?>
        </article>

        <?php if ($related_post) { ?>
          <!-- Related Post -->
          <div class="iblogs-related-post">
            <h3 class="iblogs-line-title"><?php echo $text_related_post; ?></h3>

            <div class="swiper-viewport">
              <div id="carousel-rel-post" class="swiper-container">
                <div class="swiper-wrapper">
                <?php foreach ($related_post as $rel_post) { ?>
                  <div class="swiper-slide">
                    <div class="post-item">
                      <div class="post-image">
                        <a href="<?php echo $rel_post['url_more']; ?>"><img src="<?php echo $rel_post['image']; ?>" title="<?php echo $rel_post['title']; ?>" alt="<?php echo $rel_post['title']; ?>" class="img-responsive"></a>
                      </div>
                      <a href="<?php echo $rel_post['url_more']; ?>"><h4 class="post-title"><?php echo $rel_post['title']; ?></h4></a>
                    </div>
                  </div>
                <?php } ?>
                </div>
              </div>

              <?php if ($rel_post_arrow) { ?>
                <div class="swiper-pager">
                  <div class="swiper-button-next"></div>
                  <div class="swiper-button-prev"></div>
                </div>
              <?php } ?>
            </div>

            <script>
            $('#carousel-rel-post').swiper({
              mode: 'horizontal',
              autoplay: 2500,
              slidesPerView: 3,
              slidesPerColumn: 1,
              slidesPerGroup: 1,
              spaceBetween: 20,
              breakpoints: {
                992: { // window width is <= 992px
                  slidesPerView: 2,
                  slidesPerColumn: 2,
                  spaceBetween: 10
                },
                768: { // window width is <= 768px
                  slidesPerView: 1,
                  slidesPerColumn: 3,
                  spaceBetween: 10
                },
              },
              nextButton: '.swiper-button-next',
              prevButton: '.swiper-button-prev',
            });
            </script>
          </div>
        <?php } ?>

        <?php if ($related_products) { ?>
          <!-- Related Product -->
          <div class="iblogs-related-product">
            <h3 class="iblogs-line-title"><?php echo $text_related_product; ?></h3>

            <div class="swiper-viewport">
              <div id="carousel-rel-products" class="swiper-container">
                <div class="swiper-wrapper">
                <?php foreach ($related_products as $product) { ?>
                  <div class="swiper-slide">
                    <div class="product-thumb">
                      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
                      <div class="caption">
                        <h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>

                        <?php if ($product['rating']) { ?>
                          <div class="rating">
                            <?php for ($i = 1; $i <= 5; $i++) { ?>
                              <?php if ($product['rating'] < $i) { ?>
                                <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                              <?php } else { ?>
                                <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
                              <?php } ?>
                            <?php } ?>
                          </div>
                        <?php } ?>

                        <?php if ($product['price']) { ?>
                          <p class="price">
                            <?php if (!$product['special']) { ?>
                              <?php echo $product['price']; ?>
                            <?php } else { ?>
                              <span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
                            <?php } ?>

                            <?php if ($product['tax']) { ?>
                              <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
                            <?php } ?>
                          </p>
                        <?php } ?>
                      </div>

                      <?php if ($theme == 'journal2'  ) { ?>
                        <div class="text-center">
                          <button type="button" class="btn btn-default <?php echo $theme == 'journal2' ? 'button' : ''; ?>" data-islpr-add-cart="<?php echo $product['product_id']; ?>"><?php echo $button_cart; ?></button>
                        </div>
                      <?php } else { ?>
                        <div class="button-group">
                          <button type="button" data-islpr-add-cart="<?php echo $product['product_id']; ?>"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
                          <button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" data-islpr-add-wishlist="<?php echo $product['product_id']; ?>"><i class="fa fa-heart"></i></button>
                          <button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" data-islpr-add-compare="<?php echo $product['product_id']; ?>"><i class="fa fa-exchange"></i></button>
                        </div>
                      <?php } ?>
                    </div>
                  </div>
                <?php } ?>
                </div>
              </div>

              <?php if ($rel_product_arrow) { ?>
                <div class="swiper-pager">
                  <div class="swiper-button-next"></div>
                  <div class="swiper-button-prev"></div>
                </div>
              <?php } ?>
            </div>

            <script>
            $('#carousel-rel-products').swiper({
              mode: 'horizontal',
              autoplay: 2500,
              slidesPerView: 4,
              slidesPerColumn: 1,
              slidesPerGroup: 1,
              spaceBetween: 20,
              breakpoints: {
                992: { // window width is <= 992px
                  slidesPerView: 2,
                  slidesPerColumn: 2,
                  spaceBetween: 10
                },
                768: { // window width is <= 768px
                  slidesPerView: 1,
                  slidesPerColumn: 3,
                  spaceBetween: 10
                },
              },
              nextButton: '.swiper-button-next',
              prevButton: '.swiper-button-prev',
            });
            </script>
          </div>
        <?php } ?>

        <?php if ($post_view['comment']) { ?>
          <div class="iblogs-comment">

            <h3 class="iblogs-line-title"><?php echo $text_comments; ?></h3>


            <?php if ($post_view['comment'] == 'disqus' && $post_view['comment_disqus']) { ?>
              <script type="text/javascript">
                var disqus_shortname = '<?php echo $post_view["comment_disqus"]; ?>';
                (function() {
                  var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                  dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
                  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
                })();
              </script>
              <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
              <div id="disqus_thread"></div>
            <?php } ?>

            <?php if ($post_view['comment'] == 'facebook') { ?>
              <div id="fb-root"></div>
              <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.2"></script>
              <div class="fb-comments" data-href="<?php echo $post['canonical']; ?>" data-width="100%" data-numposts="10"></div>
            <?php } ?>
          </div>
        <?php } ?>

      </div> <!-- /.iblogs-content -->

<?php if (!empty($custom_css)) { ?>
<style>
  <?php echo $custom_css; ?>
</style>
<?php } ?>

      <?php echo $content_bottom; ?>
    </div>

    <?php echo $column_right; ?></div>
</div>
<?php echo $footer; ?>
