<?php get_header(); ?>
<?php if (get_theme_mod( 'charsoogh_single_blog_layout' ) == 'sidebar_none'){$blog_layout = 'col-md-12';}else{$blog_layout = 'col-md-8';} ?>
<main class="content">
            <section class="block">
                <div class="container">
                    <div class="row">
<?php if (get_theme_mod( 'charsoogh_single_blog_layout' ) == 'sidebar_right' || empty(get_theme_mod( 'charsoogh_single_blog_layout' ))){ get_sidebar(); } ?>
                        <div class="<?php echo $blog_layout; ?>">
                          <?php if(have_posts()):?>
                            <?php while(have_posts()) :the_post();?>
                            <article class="blog-post blog-archive clearfix">
                              <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                                <?php if(has_post_thumbnail()){the_post_thumbnail();} else{ ?>
                                <img src="<?php bloginfo('template_directory'); ?>/assets/img/featured-image-missing.png" alt="<?php _e('No image available' , 'charsoogh'); ?>">
                              <?php } ?>
                              </a>
                              <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                                <h2><?php the_title(); ?></h2>
                              </a>
                                <div class="blog-post-content">
                                  <?php the_excerpt(); ?>
                                </div>
                                <div class="read-more-archive">
                                  <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><button class="btn btn-primary"><?php _e('Read More' , 'charsoogh'); ?></button></a>
                                </div>
                            </article>
                            <?php endwhile; endif; ?>

                            <nav class="pagination">
                            <?php charsoogh_pagination(); ?>
                            </nav>


                        </div>
                        <!--end col-md-8-->
<?php if (get_theme_mod( 'charsoogh_single_blog_layout' ) == 'sidebar_left'){ get_sidebar(); } ?>
                    </div>
                </div>
                <!--end container-->
            </section>
            <!--end block-->
        </main>
<?php get_footer(); ?>
