<?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="container">
      <div class="row">
          <div class="col-xl-7 col-lg-6 col-md-8 col-sm-12 innheadlhs">
              <div class="headinnbox">
                  <?php //the_title( '<h1 class="ht-main-title wow zoomIn">', '</h1>' ); ?>
                  <?php if( get_theme_mod('breadcrumb_button_display','show' ) == 'show') : ?>
                  <div class="breadcrumbbox wow zoomIn">
                      <div class='button'><?php luzuk_lite_the_breadcrumb(); ?></div>
                      <div class="clearfix"></div>
                  </div>
                  <?php endif ?>
              </div>
          </div>
          <div class="col-xl-5 col-lg-6 col-md-4 col-sm-12  pd-0" >
            <div class="innheadrhs" <?php  if (!empty($image)) : ?> style="background: url('<?php echo esc_url($image); ?>'); background-repeat: no-repeat; background-size:cover; position: relative;"<?php endif ?>>
            </div>
          </div>
          <div class="clearfix"></div>
      </div>
      <div class="clearfix"></div>
  </div>
</header>

<main id="innerpage-box">
    <div class="container">
        <div class="inner_contentbox">
    
               <!--  <div class="col-md-4 col-sm-4">
                    <div id="secondary" class="widget-area">
                          <//?php  dynamic_sidebar('luzuk-blog-sidebar'); ?>
                    </div>
                </div> -->
            <div id="blog-box" class="ht-blog-wrap innerpage-whitebox ">
                <div class="row mr-0">
              <?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 col-lg-4 col-md-6 col-sm-6 col-xs-12 wow zoomIn">
                        <?php 
                            $blgtxtlimit = get_theme_mod('blgtxtlimit', '110');
                        ?> 
                    <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(); ?>">
                                <?php if( get_theme_mod('postdate_button_display','show' ) == 'show') :?>
                                    <div class="blog-Athr">
                                        <i class="fa fa-user-o" aria-hidden="true"></i>
                                        <span>By Admin</span>
                                    </div>
                                    <div class="blog-admin">
                                        <div class="row">
                                            <div class="blog-adminbx col-xl-6 col-lg-8 col-md-6">
                                                <i class="fa fa-calendar" aria-hidden="true"></i>
                                                <span><?php echo get_the_date( 'j M y' ); ?></span>
                                            </div>
                                            <div class="blog-comment col-xl-6 col-lg-4 col-md-6">
                                              <i class="fa fa-comment-o"></i><?php echo $my_var = get_comments_number(); ?> 
                                            </div>
                                        </div>
                                    </div>
                                <?php endif ?>
                                <div class="steam">
                                    <span style="--1:1;"></span>
                                    <span style="--1:3;"></span>
                                    <span style="--1:16;"></span>
                                    <span style="--1:5;"></span>
                                    <span style="--1:18;"></span>
                                    <span style="--1:13;"></span>
                                    <span style="--1:20;"></span>
                                    <span style="--1:6;"></span>
                                    <span style="--1:7;"></span>
                                    <span style="--1:10;"></span>
                                    <span style="--1:8;"></span>
                                    <span style="--1:17;"></span>
                                    <span style="--1:11;"></span>
                                    <span style="--1:12;"></span>
                                    <span style="--1:14;"></span>
                                    <span style="--1:2;"></span>
                                    <span style="--1:9;"></span>
                                    <span style="--1:15;"></span>
                                    <span style="--1:4;"></span>
                                    <span style="--1:19;"></span>
                                    <span style="--1:1;"></span>
                                    <span style="--1:3;"></span>
                                    <span style="--1:16;"></span>
                                    <span style="--1:5;"></span>
                                    <span style="--1:18;"></span>
                                    <span style="--1:13;"></span>
                                    <span style="--1:20;"></span>
                                    <span style="--1:6;"></span>
                                    <span style="--1:7;"></span>
                                    <span style="--1:10;"></span>
                                    <span style="--1:8;"></span>
                                    <span style="--1:17;"></span>
                                    <span style="--1:11;"></span>
                                  </div>
                            </a>
                            
                        </div>
                        <div class="inner-blogpost-info">
                            <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                            <div class="inner-blog-excerpt">
                                <?php 
                                   if (has_excerpt()) {
                                              echo get_the_excerpt();
                                          } else {
                                              echo luzuk_excerpt(get_the_content(),$blgtxtlimit );  
                                       }
                                ?> 
                            </div>

                            <?php
                                $blog_button2 = get_theme_mod('blog_button2', 'View More');
                            ?>
                            <?php if($blog_button2) { ?>
                                <div class="bloginnbtn">  
                                    <a class= "btn" href="<?php echo esc_url(get_permalink()); ?>">
                                        <span><?php echo $blog_button2 ?></span>
                                    </a>
                                    <div class="clearfix"></div>
                                </div> 
                            <?php }?>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <script type="text/javascript">
                        var title = 0;
                        jQuery(".page-template-blog-left-sidebar .inner-blogpost").each(function(){
                          if ($(this).height() > title) { title = $(this).height(); }
                        });
                        jQuery(".page-template-blog-left-sidebar .inner-blogpost").height(title);


                        // on Resize change height

                        jQuery(window).resize(function(){
                          jQuery(".page-template-blog-left-sidebar .inner-blogpost").height("");
                          var title = 0;
                          jQuery(".page-template-blog-left-sidebar .inner-blogpost").each(function(){
                            if ($(this).height() > title) { title = $(this).height(); }
                          });
                          jQuery(".page-template-blog-left-sidebar .inner-blogpost").height(title);
                        });
                    </script>
                  <!-- <script>
                      jQuery.noConflict();
                      $(function(){
                        function innerblogpostHeight(){
                          var ht = 0;
                          $('.page-template-blog-left-sidebar .inner-blogpost').each(function(i){
                            var tHt = $(this).height();
                            if(ht<tHt){
                              ht=tHt;
                            }
                          });
                          $('.page-template-blog-left-sidebar .inner-blogpost').height(ht+'px');
                        }
                        innerblogpostHeight();
                      });
                      $( window ).resize(function(){
                        innerblogpostHeight();
                      });
                  </script> -->
              </div> 

           <?php
               endwhile;
            endif;
            wp_reset_postdata();
            ?>
              <div class="clearfix"></div>
          </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 class="clearfix"></div>
      
      </div>
    </div>
</main>
<?php get_footer(); ?>
