<?php get_header(); ?>


<!--single -->
	<div class="container">
    	<div class="row">
        	<section class="col-md-12  single leftcontent ">
        		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
			 <?php if ( has_post_thumbnail()) {
  $kp_imgpost = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), "full" );
 }
  else { $kp_imgpost = " ";} ?> 
  
  <?php
   global $post;
  $kp_page_for_posts = get_option( 'page_for_posts' );
  ?>
  
  
                <div class="top-title col-md-12">
                    <h1 data-animated="fadeIn" class="centered"><?php the_title(); ?> </h1>
                    	<div class="breadcrumbs centered"> <?php slant_breadcrumbs(); ?>
						
					<div class="posts-nav">
						<div class="right next"><?php next_post_link('%link',  '%title <i class="fa fa-long-arrow-right"></i>', FALSE); ?> </div>        
						<div class="left prev"><?php previous_post_link('%link',  '<i class="fa fa-long-arrow-left"></i> %title', FALSE); ?></div>
					 </div>   
						
						 <div class="clearfix"></div>
						</div>
                    </div>
                    <div class="clearfix"></div>
                    
                    <div class="post">
     
                       
					
					 
					 <div class="col-md-9 ">
					 
					<div class="img-body">
                    	<?php    get_template_part( 'includes/post-format/single', get_post_format() );   ?>
                          
                        </div>
					
						
					   <h2 class="single-title"><?php the_title(); ?></h2>
					   
					   	
						<div class="post-meta blog-content">
	<?php _e('Posted at ', 'KP_THEME_NAME');?>  <?php the_time('d');?>  <?php the_time('M'); ?>  <?php the_time('Y'); ?> , <?php _e('By ', 'KP_THEME_NAME');  the_author_posts_link(); _e(' Categories: ', 'KP_THEME_NAME');  the_category(', '); ?></div><!-- End of Meta Date -->
                   
					<p><?php the_content(); ?></p>
                    </br></br>
					<?php if (isset($kp_options['enable_blog_share']) && $kp_options['enable_blog_share'] == "1") { ?>
					<div class="single-post-share">
					<h4>Share :</h4><?php slant_social_sharing_buttons(); ?>
					</div>
					<?php } ?>
					<p class="post-tags"><?php the_tags(); ?></p>
					<div class="clearfix"></div>
				
					<?php comments_template(); ?>
					</div>
					
					 <div class="col-md-3">
              	<p> <?php get_sidebar(); ?></p>
              	</div>
              	<div class="clearfix"></div>
					 
					 
					
					 
					 <?php endwhile; endif; ?>
                    
                 
                    
              	<div class="clearfix"></div>
               
              
                <?php
//for use in the loop, list 5 post titles related to first tag on current post
$kp_tags = wp_get_post_tags($post->ID);
if ($kp_tags) {
  $kp_first_tag = $kp_tags[0]->term_id;
  $kp_args=array(
    'tag__in' => array($kp_first_tag),
    'post__not_in' => array($post->ID),
    'showposts'=>4,
    'ignore_sticky_posts'=>1
   );
  $kp_my_query = new WP_Query($kp_args);
  if( $kp_my_query->have_posts() ) { ?>
    <div class="col-md-12"> 
     <div class="related"> 
	  <div class="col-md-12">
	 <h2><?php echo _e('Related Posts',KP_THEME_NAME);?></h2><div class="clearfix"></div></div>
	 <?php
    while ($kp_my_query->have_posts()) : $kp_my_query->the_post(); ?>
     <?php 
 if ( has_post_thumbnail()) {
  $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), "blog-thumb-related" );
  ?>
<div class="col-md-3 col-sm-4 col-xs-12">
                    	<a href="<?php the_permalink() ?>">
                        	<img src="<?php echo $imgsrc[0]; ?>" class="img-responsive" alt="" />
                           
                          <h3>  <?php the_title(); ?> </h3>
                          
	<h5><?php _e('Published', 'KP_THEME_NAME');?>  <?php the_time('d');?>  <?php the_time('M'); ?>  <?php the_time('Y'); ?> </h5> 
	<!-- End of Meta Date -->
                        </a>
                    </div>
      <?php
 }

    endwhile;
  } ?>
    <div class="clearfix"></div>
     </div>  <div class="clearfix"></div></div> 
  <?php
}
?>
                
                
        
           </div>
                
                 
    
            </section>
        </div>
    </div>
<!--single -->


<?php get_footer(); ?>