<?php 
if(get_theme_mod('singlepostblog_section_disable') != 'on' ){ ?>

	<?php 
	if( get_theme_mod('sec_singlepostblogsectionTpadding',true) ) {
		$sec_singlepostblogsectionTpadding = 'padding-top:'.esc_attr(get_theme_mod('sec_singlepostblogsectionTpadding')).';';
	}
	if( get_theme_mod('sec_singlepostblogsectionBpadding',true) ) {
		$sec_singlepostblogsectionBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('sec_singlepostblogsectionBpadding')).';';
	}
	if( get_theme_mod('sec_singlepostblogsectionLpadding',true) ) {
		$sec_singlepostblogsectionLpadding = 'padding-left:'.esc_attr(get_theme_mod('sec_singlepostblogsectionLpadding')).';';
	}
	if( get_theme_mod('sec_singlepostblogsectionRpadding',true) ) {
		$sec_singlepostblogsectionRpadding = 'padding-right:'.esc_attr(get_theme_mod('sec_singlepostblogsectionRpadding')).';';
	}
	if( get_theme_mod('sec_singlepostblogsectionOpacity',true) ) {
		$sec_singlepostblogsectionOpacity = 'opacity:'.esc_attr(get_theme_mod('sec_singlepostblogsectionOpacity')).';';
	}
	?>	

	<section id="singlepost-news-slider" class="wow fadeInUp" style="<?php echo esc_attr($sec_singlepostblogsectionTpadding); ?>" "<?php echo esc_attr($sec_singlepostblogsectionBpadding); ?>" "<?php echo esc_attr($sec_singlepostblogsectionLpadding); ?>" "<?php echo esc_attr($sec_singlepostblogsectionRpadding); ?>">

		<div class="container">

			
			<?php 
			$luzuk_singlepostblog_post_count = get_theme_mod('luzuk_singlepostblog_post_count', 3 );
			$luzuk_singlepostblog_cat_exclude = get_theme_mod('luzuk_singlepostblog_cat_exclude');
			$luzuk_singlepostblog_cat_exclude = explode(',', $luzuk_singlepostblog_cat_exclude);
			$args = array(
				'posts_per_page' => absint($luzuk_singlepostblog_post_count),
				'category__not_in' => $luzuk_singlepostblog_cat_exclude
			);
			$query = new WP_Query($args);
			if($query -> have_posts()):
				while($query -> have_posts()) : $query -> the_post();
					$lz_fitness_image = wp_get_attachment_image_src(get_post_thumbnail_id() , 'total-blog-thumb');
					?>
					<?php 
					if(has_post_thumbnail()){
						$img = esc_url($lz_fitness_image[0]);
					}
					if(empty($lz_fitness_image)){
						$img = get_template_directory_uri().'/images/nothumb-featured.png';
					}
					?>
					<div class="col-md-4 col-sm-6 col-xs-12 blog-single-innerbx wow fadeInUp">
						<div class="single-post">
							<div class="row justify-content-center"> 
								<div class="section-title">
									<h2><?php the_title(); ?></h2>
									<span class="section__border"></span>
								</div>
							</div>

							<figure class="inner-blog navy">
								<a class="postimg-link" href="<?php the_permalink(); ?>">
								<img class="blog-img" src="<?php echo $img; ?>" alt="<?php the_title(); ?>">
							</a>
								<figcaption><span>By <?php echo get_the_author(); ?></span>
									<h3>By <?php echo get_the_author(); ?></h3>
									<a href="<?php the_permalink(); ?>"></a>
								</figcaption>
							</figure>
							<div class="articles-date">
								<li><i class="fa fa-calendar"></i><?php echo get_the_date( 'M' ); ?>
								<?php echo get_the_date( 'j' ); ?>,
								<?php echo get_the_date( 'Y' ); ?>
							</li>
							<li>
								<i class="fa fa-comment" aria-hidden="true"></i> Comments (<?php echo $my_var = get_comments_number(); ?> )
							</li>

						</div>
						<p class="post-description">
							<?php 
							if(has_excerpt()){
								echo get_the_excerpt();
							}else{
								echo lz_fitness_excerpt( get_the_content() , 100 );
							}
							?>
						</p>
						<?php if( get_theme_mod('blog_button_display','show' ) == 'show') :
							?>
							<?php
							$blogbutn_text = get_theme_mod('blogbutn_text', 'Read More');
							?>
							<div class="blog-read-more">
								<a href="<?php the_permalink(); ?>"><?php echo $blogbutn_text; ?> <i class="fa fa-long-arrow-right"></i> </a>
							</div>
						<?php endif ?>

					</div>
				</div>
				<?php
			endwhile;
		endif;
		wp_reset_postdata(); 
		?>
		
	</div>

</section>
<?php }