<?php 
get_header();
$title = esc_attr__('Posts tagged &quot;', 'Aruna') . single_tag_title('', false) . '&quot;';
?>
<section id="main" role="main">
    <div class="container">
        <div class="row">
            <div class="col-sm-9 right-content profile-bg">
                <div class="row">
                    <?php if($redux_demo['ad1'] != '') {
                        echo '<div class="header_ad">' . $redux_demo['ad1'] . '</div>';
                    } ?>
                    <div class="category-wrap">
                        <div class="col-sm-9 border-right">
                            <div class="outer">
                                <div class="inner">
                                    <h2><?php echo $title;?></h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="outer">
                                <div class="inner">
                                    <div class="total-posts">
                                        <h2><?php if(isset($wp_query->found_posts) ) echo $wp_query->found_posts; else echo '0'; ?></h2>
                                    </div>
                                    <div class="total-posts-description"><?php _e('Total Posts', 'Aruna');?></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-9">
                        <?php if($redux_demo['ad2'] != '') {
                            echo '<div class="header_ad">' . $redux_demo['ad2'] . '</div>';
                        } ?>
                        <div class="main-wrap">
                            <?php 
                            if ( have_posts() ) :
                                $count = 1;
                                while ( have_posts() ) : the_post(); 
                                    if($count == 3 && $redux_demo['ad3'] != '') {
                                        echo '<div class="header_ad ad_between">' . $redux_demo['ad3'] . '</div>';
                                    }
                                    get_template_part( 'content', get_post_format() );
                                    $count++;
                                endwhile; 
                            endif; 
                            ?>
                        </div>
                    </div>
                    <?php get_sidebar('right');?>
                </div>
            </div>
            <?php get_sidebar('left');?>
        </div>
    </div>
</section>
<?php get_footer();?>