<?php 
/**
 * The template for displaying archive pages.
 *
 * Used for displaying archive-type pages. These views can be further customized by
 * creating a separate template for each one.
 *
 * - author.php (Author archive)
 * - category.php (Category archive)
 * - date.php (Date archive)
 * - tag.php (Tag archive)
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 */
?>
<?php get_header(); ?>


 <?php $image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));?>

<header class="page-main-header" <?php  if (!empty($image)) : ?> style="background: url('<?php echo esc_url($image); ?>'); background-repeat: no-repeat; background-size:cover; position: relative;"<?php endif ?> >
    <div class="overlay1"></div>
    <?php if( get_theme_mod('header_animation_display','show' ) == 'show') : ?>
    <div class="headimgbx">
        <?php 
            $h_inn1_image = get_theme_mod('h_inn1_image');
            if(!empty($h_inn1_image)){
                echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($h_inn1_image).'" class="img-responsive secondry-bg-img" />';
            }else{
                echo '<img  src="'.get_template_directory_uri().'/images/smv1.png" class="img-responsive hinn1" />';
            }
        ?> 

        <?php 
            $h_inn2_image = get_theme_mod('h_inn');
            if(!empty($h_inn)){
                echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($h_inn).'" class="img-responsive secondry-bg-img" />';
            }else{
                echo '<img  src="'.get_template_directory_uri().'/images/smv2.png" class="img-responsive hinn2" />';
            }
        ?> 

        <?php 
            $h_inn3_image = get_theme_mod('h_inn3_image');
            if(!empty($h_inn3_image)){
                echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($h_inn3_image).'" class="img-responsive secondry-bg-img" />';
            }else{
                echo '<img  src="'.get_template_directory_uri().'/images/smv3.png" class="img-responsive hinn3" />';
            }
        ?>

        <?php 
            $h_inn3_image4_image = get_theme_mod('h_inn3_image4_image');
            if(!empty($h_inn3_image4_image)){
                echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($h_inn3_image4_image).'" class="img-responsive secondry-bg-img" />';
            }else{
                echo '<img  src="'.get_template_directory_uri().'/images/smv4.png" class="img-responsive hinn4" />';
            }
        ?>
    </div>
    <?php endif ?>
        <?php if( get_theme_mod('breadcrumb_button_display','show' ) == 'show') : ?>
        <div class="  container" >
            <div class="headinnbox">    
                <div class="breadcrumbbox ">
                    <div class='button'><?php luzuk_lite_the_breadcrumb(); ?></div>
                    <div class="clearfix"></div>
                </div>
                 <?php the_archive_title( '<h1 class="ht-main-title">', '</h1>' ); ?>
            </div>
            <?php endif ?>
        </div>
        <div class="clearfix"></div>
    <!-- </div> -->
    <div class="clearfix"></div>
</header>

<main id="innerpage-box">
	<div class="container">
		<div class="inner_contentbox">
			<div class="row mr-0">
				<div id="blog-box" class="col-lg-9 col-md-8 innerpage-whitebox">
					<div class="innerblogpost">
						<?php if ( have_posts() ) :
							$luzuk_lite_full_posts = get_theme_mod('luzuk_lite_full_posts');
							while ( have_posts() ) : the_post();
								luzuk_lite_archive_post();
							endwhile;
							luzuk_lite_post_navigation();
						endif; ?>
					</div>	
				</div> 
				<div class="col-lg-3 col-md-4 ">
					<div id="secondary" class="widget-area">
						<?php dynamic_sidebar('luzuk-blog-sidebar'); ?>
					</div>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>
		<div class="clearfix"></div>
		<div class="row mr-0">
			<div class="col-md-12">
				<div class="pagingation">
			    	<?php lzGetPagination($query);?>
				</div>
			</div>
		</div>
	</div>
</main>

<script>
      jQuery.noConflict();
      $(function(){
      function innerblogpostHeight(){
        var ht = 0;
        $('.inner-blogpost-info').each(function(i){
          var tHt = $(this).height();
          if(ht<tHt){
            ht=tHt;
          }
        });
        $('.inner-blogpost-info').height(ht+'px');
      }
      innerblogpostHeight();
    });
    $( window ).resize(function(){
      innerblogpostHeight();
    });
</script>

<?php get_footer(); ?>
<!--<div id="page" class="home-page">
	<div id="content" class="article">
		<h1 class="postsby">
			<span><//?php //the_archive_title(); ?></span>
		</h1>	
		<//?php ///if ( have_posts() ) :
			//$luzuk_lite_full_posts = get_theme_mod('luzuk_lite_full_posts');
			//while ( have_posts() ) : the_post();
				//luzuk_lite_archive_post();
			//endwhile;
			//luzuk_lite_post_navigation();
		//endif; ?>
	</div>
	<//?php //get_sidebar(); ?>
</div>
<//?php //get_footer(); ?>