<?php get_header(); ?>
<!--Archive -->
<section class="blog-main">
	<div class="container">
    	<div class="row">
        	 <?php if (!is_front_page()) { ?>	
				   <div class="top-title col-md-12">
                    <h1 data-animated="fadeIn" class="centered">

                  <?php if(is_author()){

							printf( __( 'All posts by %s', KP_THEME_NAME ), get_the_author() );

						} else if(is_category()) {

							printf( __( 'Category Archives: %s', KP_THEME_NAME ), single_cat_title( '', false ) );

						} else if(is_date()){

							if ( is_day() ) :
								printf( __( 'Daily Archives: %s', KP_THEME_NAME ), get_the_date() );

							elseif ( is_month() ) :
								printf( __( 'Monthly Archives: %s', KP_THEME_NAME ), get_the_date( _x( 'F Y', 'monthly archives date format', KP_THEME_NAME ) ) );

							elseif ( is_year() ) :
								printf( __( 'Yearly Archives: %s', KP_THEME_NAME ), get_the_date( _x( 'Y', 'yearly archives date format', KP_THEME_NAME ) ) );

							else :
								_e( 'Archives', KP_THEME_NAME );

							endif;
						} else {
							wp_title("",true); 
						} ?>

					<?php
					  global $post;
					  $kp_page_for_posts = get_option( 'page_for_posts' );
					  ?>
					  </h1>
					<div class="breadcrumbs centered"> <?php slant_breadcrumbs(); ?>
			
						 <div class="clearfix"></div>
						</div>
                    </div>
                    <div class="clearfix"></div>
			<?php } else{ ?>
			  <div class="top-title col-md-12">
                    <h1 data-animated="fadeIn" class="centered">
					<?php wp_title("",true); ?>
					</h1></div>
			
			<?php } ?>
			
			<?php
				global $slant_options;
				$kp_items = get_option( 'posts_per_page'); 
				$kp_layout = $kp_options['blog_layout_style'];
				if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
				elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
				else { $paged = 1; }
				if($kp_layout=='2col'){
				wp_enqueue_script( 'imagesloaded' );
				}
			$kp_main_class ="col-md-9";	
			if (isset($kp_options['enable_fullwidth']) && $kp_options['enable_fullwidth'] == "1") {
			$kp_main_class = "col-md-12";
			}
		
			?>
			
			<div id="blog-main" class="<?php echo $kp_main_class; ?>" <?php if($kp_layout=='2col'){?> data-mas-enable="1" <?php }?>>
			
			
			  <?php
					$kp_args = array(
						'post_type' => 'post',
						'paged' => $paged,
						'posts_per_page' => $kp_items,
					);
		
					$posts = new WP_Query($kp_args);

			  if( $posts->have_posts() ) : while ($posts->have_posts()) : $posts->the_post(); 
				if($kp_layout=='2col'){ echo'<div class="post-item col-md-6">';}
                  get_template_part( 'includes/post-format/content', get_post_format() ); 
				 if($kp_layout=='2col'){echo '</div>';}
				endwhile;  ?>
				 <div class="clearfix"></div>
				<?php
				slant_pagination($posts->max_num_pages, $range = 2);	
				else : ?>
                    <h2><?php _e('No Posts Found', KP_THEME_NAME) ?></h2>
                    <?php
                endif; 
                wp_reset_query();
				?>
											
                 <div class="clearfix"></div>
				 </div>
				 <?php if (isset($kp_options['enable_fullwidth']) && $kp_options['enable_fullwidth'] != "1") { ?>
				  <div class="col-md-3">
				    <?php get_sidebar(); ?>
				  </div>
				  <?php } ?>

        </div>
    </div>
</section><!--END SECTION -->
<?php get_footer(); ?>