<?php
/**
 *
 * @package LZ Fitness Premium
 */

if(get_theme_mod('luzuk_blog_section_disable') != 'on' ){ ?>
<section id="ht-blog-section" class="ht-section">
	<div class="lightbox">
		<div class="row">

			<div class="ht-blog-wrap col-md-5 col-md-offset-1">
				<?php
				$luzuk_blog_title = get_theme_mod('luzuk_blog_title', 'LATEST NEWS');
		//$luzuk_blog_sub_title = get_theme_mod('luzuk_blog_sub_title', 'Here goes the short description for the section');
				?>
				<?php if($luzuk_blog_title || $luzuk_blog_sub_title){ ?>

			<!--<?php //if($luzuk_blog_title){ ?>
				<h2 class="ht-section-title lz-blog-heading"><?php //echo esc_html($luzuk_blog_title); ?></h2>
				<?php //} ?>-->

			<!--<?php //if($luzuk_blog_sub_title){ ?>
				<div class="ht-section-tagline lz-blog-text"><?php //echo esc_html($luzuk_blog_sub_title); ?></div>
			<?php //} ?>
		</div>-->
		<?php } ?>
		
		<div class="tabset">

			<input type="radio" name="tabset" id="tab1" aria-controls="marzen" checked>
			<label for="tab1">
				<?php if($luzuk_blog_title || $luzuk_blog_sub_title){ ?>
					<?php if($luzuk_blog_title){ ?>
					<h2><?php echo esc_html($luzuk_blog_title); ?></h2>
					<?php } ?>
				<?php } ?>
			</label>

			<input type="radio" name="tabset" id="tab2" aria-controls="rauchbier">
			<label for="tab2"><h2>FAQ</h2></label>


			<div class="tab-panels">
				<div id="marzen" class="tab-panel">
					<?php 
					$luzuk_blog_post_count = get_theme_mod('luzuk_blog_post_count', 2 );
					$luzuk_blog_cat_exclude = get_theme_mod('luzuk_blog_cat_exclude');
					$luzuk_blog_cat_exclude = explode(',', $luzuk_blog_cat_exclude);
					$luzuk_blog_post_count++;
					$args = array(
						'posts_per_page' => $luzuk_blog_post_count,
					);
					if(!empty($luzuk_blog_cat_exclude)){
						$args['category__not_in'] = $luzuk_blog_cat_exclude;
					}
					$args['paged']=1;
					print_r($args);
					$query = new WP_Query($args);
					if($query -> have_posts()):
						while($query -> have_posts()) : $query -> the_post();
							$luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id() , 'total-blog-thumb');
							?>
							<?php 
							if(has_post_thumbnail()){
								$img = esc_url($luzuk_image[0]);
							}
							if(empty($luzuk_image)){
								$img = get_template_directory_uri().'/images/about.jpg';
							}
							?>
							<div class="ht-blog-post">

								<div class="blog-date"><i class="fa fa-calendar-o" aria-hidden="true"></i><?php echo get_the_date(); ?></div>
								<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
								<div class="ht-blog-excerpt">
									<?php 
									if(has_excerpt()){
										echo get_the_excerpt();
									}else{
										echo luzuk_excerpt( get_the_content() , 190 );
									}
									?>
									<a href="<?php the_permalink(); ?>"><?php _e('Read More', 'total'); ?></a>
								</div>
							</div>
							<?php
						endwhile;
					endif;
					wp_reset_postdata();
					?>			
				</div>
				<div id="FAQ" class="tab-panel">
					asasas            
				</div>
			</div>
		</div>
		
	</div>

	<div class="col-md-6 blog-box-img padding0">
		<div class="inside-full-height">
			<img src="<?php echo esc_html(get_template_directory_uri()); ?>/images/blog.jpg" />
		</div>
	</div>
	<div class="clearfix"></div>

</section>
<?php }