<?php
/**
 * Template Name: Blog full width
 *
 * @package luzuk Premium 
 */
get_header(); 
?>
  <?php $image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));?>
<header class="page-main-header">
    <div class="overlay"></div>
    <div class="inn-header-img" <?php  if (!empty($image)) : ?>
             style="background: url('<?php echo esc_url($image); ?>'); background-repeat: no-repeat; background-size:cover; position: absolute;background-position: center;    background-attachment: fixed;" <?php endif ?>></div>
    <div class="container">
        <?php the_title( '<h1 class="ht-main-title wow zoomIn">', '</h1>' ); ?>
        <div class="clearfix"></div>
    </div>
     <?php if( get_theme_mod('breadcrumb_button_display','show' ) == 'show') :
        ?>
        <div class="breadcrumbbox wow zoomIn">
            <div class="container">
                <div class='button'><?php luzuk_lite_the_breadcrumb(); ?></div>
                <!--  <?php //luzuk_lite_the_breadcrumb(); ?> -->
            </div>
        </div>
    <?php endif ?>  
<div class="clearfix"></div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1500" height="189.947" viewBox="0 0 1500 189.947">
  <defs>
    <linearGradient id="linear-gradient" x1="0.993" y1="0.621" x2="0.007" y2="0.631" gradientUnits="objectBoundingBox">
      <stop offset="0" stop-color="#ffa200"/>
      <stop offset="1" stop-color="#ff6f00"/>
    </linearGradient>
  </defs>
  <path id="Rectangle_1" data-name="Rectangle 1" d="M88,942.061H1186.795c51.628,0,145.778-144.536,234.521-135.975h166.568l-.625,171.277H88Z" transform="translate(-87.884 -800.72)" fill-rule="evenodd" fill="url(#linear-gradient)"/>
  <path id="Rectangle_1-2" data-name="Rectangle 1" d="M90,945.835H1210.6c51.8,0,140.946-139.307,229.987-130.746H1590V979.829H90.116Z" transform="translate(-90 -789.882)" fill="#222a35" fill-rule="evenodd"/>
</svg>
</header><!-- .entry-header --> 

<main id="innerpage-box">
    <div class="container">
        <div class="inner_contentbox">
		    <div id="blog-box" class="ht-blog-wrap innerpage-whitebox">
    	    <?php
              $current_page = max(1, get_query_var('paged'));
              $luzuk_blog_cat_exclude = get_theme_mod('luzuk_blog_categories');
              $luzuk_blog_cat_exclude = explode(',', $luzuk_blog_cat_exclude);
              $excerpt = get_theme_mod('luzuk_blog_categories_settings');
              $args = array(
                  'category__not_in' => $luzuk_blog_cat_exclude,
                  // 'page'=,
                  'paged'=> $current_page,

              );
              $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');
                   $img = (has_post_thumbnail())?esc_url($luzuk_image[0]):get_template_directory_uri().'/images/default.png';
            ?>
                <div class="inner-blog-post pd-3 col-md-4 col-sm-6 col-xs-12 wow zoomIn">
                    <div class="inner-blogpost">
                        <div class="ht-blog-thumbnail">
                            <a href="<?php the_permalink(); ?>">
                                <img class="inner-blog-img" src="<?php echo $img; ?>" alt="<?php the_title(); ?>">
                                <div class="overlay"></div>
                            </a>
                            <?php if( get_theme_mod('postdate_button_display','show' ) == 'show') :
                            ?>
                            <div class="innrdate">
                            <li><?php echo get_the_date( 'M j,' ); ?></li>
                             <li class="year"><?php echo get_the_date( 'Y' ); ?></li>
                           </div>
                           <div class="innrcomment">
                                <!-- <i class="fa fa-user"></i><?//php echo get_the_author(); ?> -->
                               <i class="fa fa-commenting" aria-hidden="true"></i><?php echo $my_var = get_comments_number(); ?> Comments
                          </div>
                          <?php endif ?>
                        </div>
                        <div class="inner-blogpost-info">
                        
                            <a href="<?php the_permalink(); ?>"><h4 class="inner-area-title"><?php the_title(); ?></h4></a>
                            <p>
                              <?php 
                               if (has_excerpt()) {
                                          echo get_the_excerpt();
                                      } else {
                                          echo luzuk_excerpt(get_the_content(),160);  
                                   }
                              ?>
                            </p>
                            <?php
                                    $blog_button1 = get_theme_mod('blog_button1', 'Read More');
                                ?>
                            <?php if($blog_button1) { ?>
                                                        <div class="blogbtn"> 
                                      <a class="btn btn-lg" href="<?php echo esc_url(get_permalink()); ?>">
                                         <span>  <?php echo $blog_button1 ?></span>
                                      </a>
                                  </div> 
                           <?php }?>
                                                    <div class="clearfix"></div>
                        </div>  
                    <div class="clearfix"></div>
                    </div>
                    <script>
                      jQuery.noConflict();
                      $(function(){
                        function innerblogpostpHeight(){
                          var ht = 0;
                          $('#innerpage-box .inner-blogpost-info p').each(function(i){
                            var tHt = $(this).height();
                            if(ht<tHt){
                              ht=tHt;
                            }
                          });
                          $('#innerpage-box .inner-blogpost-info p').height(ht+'px');
                        }
                        innerblogpostpHeight();
                      });
                      $( window ).resize(function(){
                        innerblogpostpHeight();
                      });
                    </script>
                </div>    

                <?php
                   endwhile;
                endif;
                wp_reset_postdata();
                ?>
                <div class="clearfix"></div>
            </div>
            <div class="pagingation">
                <?php lzGetPagination($query);?>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</main>
<?php get_footer(); ?>