<?php
/**
 * Template part for displaying posts.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package MF Theme
 // Template Name: Blog Standard
 */

?>

<?php
	get_template_part( 'template-parts/page-headers');
	$pagebgcolor = $mf_options['page-bg-color'];
	$page_gl_titlebg = $mf_options['tr-default-pg-bg']['url'];
	
	if (isset($mf_options['cat_page'][0])) {     $p0 = $mf_options['cat_page'][0].",";    }else{    	$p0 = '' ;}
	if (isset($mf_options['cat_page'][1])) {     $p1 = $mf_options['cat_page'][1].",";    }else{    	$p1 = '' ;}
	if (isset($mf_options['cat_page'][2])) {     $p2 = $mf_options['cat_page'][2].",";    }else{    	$p2 = '' ;}
	if (isset($mf_options['cat_page'][3])) {     $p3 = $mf_options['cat_page'][3].",";    }else{    	$p3 = '' ;}
	if (isset($mf_options['cat_page'][4])) {     $p4 = $mf_options['cat_page'][4].",";    }else{    	$p4 = '' ;}
	if (isset($mf_options['cat_page'][5])) {     $p5 = $mf_options['cat_page'][5].",";    }else{    	$p5 = '' ;}
	if (isset($mf_options['cat_page'][6])) {     $p6 = $mf_options['cat_page'][6].",";    }else{    	$p6 = '' ;}
	if (isset($mf_options['cat_page'][7])) {     $p7 = $mf_options['cat_page'][7].",";    }else{    	$p7 = '' ;}
	if (isset($mf_options['cat_page'][8])) {     $p8 = $mf_options['cat_page'][8].",";    }else{    	$p8 = '' ;}
	if (isset($mf_options['cat_page'][9])) {     $p9 = $mf_options['cat_page'][9].",";    }else{    	$p9 = '' ;}
	$catpost = $p0.$p1.$p2.$p3.$p4.$p5.$p6.$p7.$p8.$p9;
  ?>

  <div class="content-main">
  <div id="primary" class="site-content">
    <div id="content" role="main" style="background-color: <?php echo esc_attr($pagebgcolor); ?>">  
      <?php get_template_part( 'template-parts/page-title'); ?>         
 
 <div class="container padding-top-100">
  <div class="row">
    <div class="col-xs-12 col-sm-8 col-md-9">
	<?php if (have_posts()) : ?>
	<?php $ibayram = new WP_Query("cat='" . $catpost ."'");
			while($ibayram->have_posts()) : $ibayram->the_post();?>

              
			
			  
			  
			  
			  <article id="post-<?php the_ID(); ?>" <?php post_class( 'blog-post-v1' ); ?>> 
                <div class="img-box">
                 <?php if ( has_post_thumbnail() ) : ?>
                  <a href="<?php the_permalink() ?>"><?php the_post_thumbnail('mf-theme-blog-full'); ?> </a>
                  <?php endif; ?>
                </div>
                <div class="blog-txt">
                  <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
                  <?php get_template_part( '/inc/meta' ); ?>
                  <p><?php echo get_the_excerpt(); ?></p>
                  <a href="<?php the_permalink() ?>" class="more"><?php echo esc_html__('Read More...', 'mf'); ?></a>
                  <div class="box-holder">
                   
                    <time datetime="2015-02-18">
                      <span class="add"><?php the_time('j') ?> </span> <?php the_time('F') ?>
                    </time>
                  </div>
                </div>
              </article>
               <?php endwhile; ?>
			    <?php endif; ?>
            <div class="col-xs-12">
              <div class="center">
        <?php
// Previous/next page navigation.
            the_posts_pagination( array(
                'screen_reader_text' => ' ', 
                'prev_text'          => esc_html__( 'Previous page', 'mf' ),
                'next_text'          => esc_html__( 'Next page', 'mf' ),
                'before_page_number' => '<span class="meta-nav screen-reader-text">' . esc_html__( 'Page', 'mf' ) . ' </span>',
               
            ) );
  ?>
      </div>
            </div>
    </div>
      <aside class="col-xs-12 col-sm-4 col-md-3">
        <?php dynamic_sidebar( 'default_sidebar' ); ?>
      </aside>
  </div>
</div>
 
      <?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); ?>
    </div>
    <!-- #content -->
  </div>
  <!-- #primary -->
</div>
<?php get_footer(); ?>
  