<?php
/**
 * The template for displaying Tag pages
   *
   *
   * @package   ospersonality WordPress Theme
   * @copyright Copyright (C) 2016, OrdaSoft
   * @license	 http://www.gnu.org/licenses/gpl-2.0.html  GNU General Public License v2 or later
   * @author	  AUTHOR <www.ordasoft.com>
   * ospersonality is distributed under the terms of the GNU GPL
   */
$sidebar_left = false;
if (is_active_sidebar( 'sidebar_left' ) ) {
    $sidebar_left = true;
}

ospersonality_header_home()
?>
<div id="main" class="site-main">
    <div id="tag" class="site-content">
        <h2 class="page-title">
            <?php printf( __( 'Tag Archives %s', 'ospersonality' ), '<span>' . single_tag_title( '', false ) . '</span>' ); ?>
        </h2>

       <div class="row">
            <?php if (is_active_sidebar( 'sidebar_left' ) ) : ?>
            <div class="widgets col-lg-3 col-md-3 col-sm-3 col-xs-12">
                <article id="sidebar-left" class="sidebar">
                    <?php  dynamic_sidebar('sidebar_left'); ?>
                </article>
            </div>
            <?php endif; ?>

            <?php if($sidebar_left) :
                echo ('<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">');
                echo ('<div class="category-content">');
            else :
                echo ('<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">');
                echo ('<div class="category-content container">');
            endif; ?>
              <?php $position = 0; ?>
            <?php if ( have_posts() ) : ?>
                <?php while ( have_posts() ) : the_post(); ?>
                  <section class="loop-item post-item">
                    <section class="post-block">
                      <section class="img-block">
                      <?php the_post_thumbnail(array(500,250)); ?>
                      </section>
                      <?php get_template_part( 'template-parts/content', get_post_format() ); ?>
                    </section>
                  </section>

                <?php endwhile; ?>
                </div>
                </div>
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <?php  the_posts_pagination(); ?>
                </div>
            

             <?php  else :

                  get_template_part( 'template-parts/content', 'none' );

               endif; ?>
      </div>
    </div>
</div><!-- #main -->
<?php get_footer(); ?>