<?php
/**
 * Template Name: Blog Template
 *
 * @package Luzuk Premium
 */
get_header(); 
?>
  <?php $image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));?>
<div class="dinero-page-main"> 
    <header class="page-main-header" 
  <?php
    if(get_theme_mod('innerpage_featured_img_on_off') != 'on' ){
  ?>

 <?php  if (!empty($image)) : ?>
  style="background: url('<?php echo esc_url($image); ?>'); background-repeat: no-repeat; background-size:cover;
   height: <?php echo esc_attr(get_theme_mod('dinero_innerpage_image_height','300')) ?>px;
  "
  <?php endif ?> 

 <?php } ?>

  >
  
<?php
    if(get_theme_mod('page_title_on_off') != 'on' ){
  ?>
    <div class="<?php if(get_theme_mod('dinero_inner_page_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_inner_page_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?> <?php echo esc_attr(get_theme_mod('dinero_innerpage_header_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="1s">
        <?php the_title( '<h1 class="ht-main-title wow zoomIn">', '</h1>' ); ?>
        <div class="clearfix"></div>
    </div>
 <?php } ?>    
  <?php
    if(get_theme_mod('breadcrumb_on_off') != 'on' ){
  ?>
         <div class="breadcrumbbox <?php echo esc_attr(get_theme_mod('dinero_innerpage_header_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="1s">
            <div class="<?php if(get_theme_mod('dinero_inner_page_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_inner_page_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">
                <div class='button'><?php luzuk_lite_the_breadcrumb(); ?></div>
                <!--  <?php //luzuk_lite_the_breadcrumb(); ?> -->
            </div>
        </div>
 <?php } ?>

</header><!-- .entry-header --> 
<div class="dinero-innerpage-overlay"></div>
</div>

<main id="innerpage-box">
  <div class="<?php if(get_theme_mod('dinero_inner_page_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_inner_page_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">
<div class="inner_contentbox">

<?php if (get_theme_mod('luzuk__blog_layout') == '1' ) { ?>

    <div class="col-md-3">
      <div id="secondary" class="widget-area">
        <?php  dynamic_sidebar('luzuk-blog-sidebar'); ?>
      </div>
    </div>

    <div id="blog-box" class="ht-blog-wrap innerpage-whitebox col-md-9">
      <?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 wow zoomIn">
                  <div class="inner-blogpost">
                   <div class="col-md-6 col-sm-6 col-xs-12">                  
                    <?php
                        if(get_theme_mod('blog_featured_img_on_off') != 'on' ){
                      ?>
                     <div class="ht-blog-thumbnail">
                       <a href="<?php the_permalink(); ?>">
                          <img class="inner-blog-img" src="<?php echo $img; ?>" alt="<?php the_title(); ?>" style="height: <?php echo esc_attr(get_theme_mod('dinero_blogpage_post_image_height','350')) ?>px;">
                      </a>
                      <div class="overlay"></div>
                       <?php if (get_theme_mod('dinero_show_date',true) != false){ ?>
                          <div class="blog-date"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo get_the_date( 'j F, Y' ); ?></div>
                        <?php }?>
                    </div>
                    <?php } ?>
                      <?php if (get_theme_mod('dinero_show_category',true) != false){ ?>
                        <div class="blog-category"> 
                          <span><i class="fa fa-file-o" aria-hidden="true"></i><?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?></span>
                        </div>
                      <?php }?>
                      <?php if (get_theme_mod('dinero_show_tags',true) != false){ ?>
                          <div class="blog-tags">
                            <i class="fa fa-tags" aria-hidden="true"></i>
                            <?php
                                  if( $tags = get_the_tags() ) {
                                    foreach( $tags as $content_tag ) {
                                      $sep = ( $content_tag === end( $tags ) ) ? '' : ' ';
                                      echo '<a href="' . esc_url(get_term_link( $content_tag, $content_tag->taxonomy )) . '" class="ml-2 mb-2">' . esc_html($content_tag->name) . '</a>' . esc_html($sep);
                                    }
                                  } ?>
              
                            </div>
                      <?php }?>
                  </div>
                   <div class="col-md-6 col-sm-6 col-xs-12"> 
                    <div class="inner-blogpost-info">
                     
                       <div class="blog-info-area"> 

                         <?php if (get_theme_mod('dinero_show_author',true) != false || get_theme_mod('dinero_show_time',true) != false || get_theme_mod('dinero_show_comments',true) != false){ ?>
                            <ul class="metabox"> 
                              <?php if (get_theme_mod('dinero_show_comments',true) != false){ ?>
                                  <li class="blog-comment"> <i class="fa fa-comment-o" aria-hidden="true"></i> Comment :  <?php echo $my_var = get_comments_number(); ?></li>
                              <?php }?>

                              <?php if (get_theme_mod('dinero_show_author',true) != false){ ?>
                               <li class="blog-author"><i class="fa fa-user" aria-hidden="true"></i> By <?php echo get_the_author(); ?> 
                              </li>
                              <?php }?>
                             
                               <?php if (get_theme_mod('dinero_show_time',true) != false){ ?>
                                <li class="blog-time"><i class="fa fa-clock-o" aria-hidden="true"></i><?php echo the_time( 'g:i a' ) ?></li>
                              <?php }?>                            
                               <div class="clearfix"></div>
                            </ul>
                          <?php }?>                         
                        </div>
                        <div class="clearfix"></div>
                          <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                          <div class="inner-blog-excerpt">
                                <?php $dinero_excerpt = get_the_excerpt(); echo esc_html( dinero_string_limit_words( $dinero_excerpt, esc_attr(get_theme_mod('dinero_blogpage_post_excerpt','20')) ) ); ?>

                          </div>

                         <?php
                        $blogbutton = get_theme_mod('blog_page_btn_txt', 'READ MORE'); 
                      ?>

                        <?php if( get_theme_mod('blog_page_button_display','show' ) == 'show') :
                          ?>  
                          <div class="blog-page-btn">
                            <a href="<?php the_permalink(); ?>" target="_blank">      
                             <i class="fa fa-caret-square-o-right" aria-hidden="true"></i> <?php echo ($blogbutton );  ?>
                            </a></div>
                          <?php endif ?>

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

                        <div class="socialMedia">
                          <ul>
                            <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
                            <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php the_title();?>" target="_blank" class="site-button sharp"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
                            
                            <li><a href="https://twitter.com/share?url=<?php the_permalink();?>&amp;text=<?php the_title();?>" class="site-button sharp" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
                            <li><a href="http://www.digg.com/submit?url=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-digg" aria-hidden="true"></i></a></li>
                            <li class="share-button"><a href="#" class="site-button sharp"><i class="fa fa-share-alt"></i></a></li>
                          </ul>
                            <div class="clearfix"></div>
                        </div>
                    <?php } ?>

                   

                   <div class="clearfix"></div>
                 </div>
               </div>
                   
               
                   <div class="clearfix"></div> 
                   
           </div>
              <script>
            jQuery.noConflict();
            $(function(){
              function innerblogpostHeight(){
                var ht = 0;
                $('.page-template-blog-template .inner-blogpost-info').each(function(i){
                  var tHt = $(this).height();
                  if(ht<tHt){
                    ht=tHt;
                  }
                });
                $('.page-template-blog-template .inner-blogpost-info').height(ht+'px');
              }
              innerblogpostHeight();
            });
            $( window ).resize(function(){
              innerblogpostHeight();
            });
          </script>
       </div> 
       <?php
   endwhile;
endif;
wp_reset_postdata();
?>
<div class="clearfix"></div>

</div>

<?php } else if (get_theme_mod('luzuk__blog_layout') == '0' ) {?>

        <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 wow zoomIn">
                   <div class="inner-blogpost">
                   <div class="col-md-6 col-sm-6 col-xs-12 pd-0">                  
                    <?php
                        if(get_theme_mod('blog_featured_img_on_off') != 'on' ){
                      ?>
                     <div class="ht-blog-thumbnail">
                       <a href="<?php the_permalink(); ?>">
                          <img class="inner-blog-img" src="<?php echo $img; ?>" alt="<?php the_title(); ?>" style="height: <?php echo esc_attr(get_theme_mod('dinero_blogpage_post_image_height','350')) ?>px;">
                      </a>
                      <div class="overlay"></div>
                       <?php if (get_theme_mod('dinero_show_date',true) != false){ ?>
                          <div class="blog-date"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo get_the_date( 'j F, Y' ); ?></div>
                        <?php }?>
                    </div>
                    <?php } ?>
                      <?php if (get_theme_mod('dinero_show_category',true) != false){ ?>
                        <div class="blog-category"> 
                          <span><i class="fa fa-file-o" aria-hidden="true"></i><?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?></span>
                        </div>
                      <?php }?>
                      <?php if (get_theme_mod('dinero_show_tags',true) != false){ ?>
                          <div class="blog-tags">
                            <i class="fa fa-tags" aria-hidden="true"></i>
                            <?php
                                  if( $tags = get_the_tags() ) {
                                    foreach( $tags as $content_tag ) {
                                      $sep = ( $content_tag === end( $tags ) ) ? '' : ' ';
                                      echo '<a href="' . esc_url(get_term_link( $content_tag, $content_tag->taxonomy )) . '" class="ml-2 mb-2">' . esc_html($content_tag->name) . '</a>' . esc_html($sep);
                                    }
                                  } ?>
              
                            </div>
                      <?php }?>
                  </div>
                   <div class="col-md-6 col-sm-6 col-xs-12 pd-0"> 
                    <div class="inner-blogpost-info">
                     
                       <div class="blog-info-area"> 

                         <?php if (get_theme_mod('dinero_show_author',true) != false || get_theme_mod('dinero_show_time',true) != false || get_theme_mod('dinero_show_comments',true) != false){ ?>
                            <ul class="metabox"> 
                              <?php if (get_theme_mod('dinero_show_comments',true) != false){ ?>
                                  <li class="blog-comment"> <i class="fa fa-comment-o" aria-hidden="true"></i> Comment :  <?php echo $my_var = get_comments_number(); ?></li>
                              <?php }?>

                              <?php if (get_theme_mod('dinero_show_author',true) != false){ ?>
                               <li class="blog-author"><i class="fa fa-user" aria-hidden="true"></i> By <?php echo get_the_author(); ?> 
                              </li>
                              <?php }?>
                             
                               <?php if (get_theme_mod('dinero_show_time',true) != false){ ?>
                                <li class="blog-time"><i class="fa fa-clock-o" aria-hidden="true"></i><?php echo the_time( 'g:i a' ) ?></li>
                              <?php }?>                            
                               <div class="clearfix"></div>
                            </ul>
                          <?php }?>                         
                        </div>
                        <div class="clearfix"></div>
                          <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                          <div class="inner-blog-excerpt">
                                <?php $dinero_excerpt = get_the_excerpt(); echo esc_html( dinero_string_limit_words( $dinero_excerpt, esc_attr(get_theme_mod('dinero_blogpage_post_excerpt','20')) ) ); ?>

                          </div>

                         <?php
                        $blogbutton = get_theme_mod('blog_page_btn_txt', 'READ MORE'); 
                      ?>

                        <?php if( get_theme_mod('blog_page_button_display','show' ) == 'show') :
                          ?>  
                          <div class="blog-page-btn">
                            <a href="<?php the_permalink(); ?>" target="_blank">      
                              <i class="fa fa-caret-square-o-right" aria-hidden="true"></i><?php echo ($blogbutton );  ?>
                            </a></div>
                          <?php endif ?>

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

                        <div class="socialMedia">
                          <ul>
                            <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
                            <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php the_title();?>" target="_blank" class="site-button sharp"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
                            
                            <li><a href="https://twitter.com/share?url=<?php the_permalink();?>&amp;text=<?php the_title();?>" class="site-button sharp" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
                            <li><a href="http://www.digg.com/submit?url=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-digg" aria-hidden="true"></i></a></li>
                            <li class="share-button"><a href="#" class="site-button sharp"><i class="fa fa-share-alt"></i></a></li>
                          </ul>
                            <div class="clearfix"></div>
                        </div>
                    <?php } ?>

                   

                   <div class="clearfix"></div>
                 </div>
               </div>
                   
               
                   <div class="clearfix"></div> 
                   
           </div>
              <script>
            jQuery.noConflict();
            $(function(){
              function innerblogpostHeight(){
                var ht = 0;
                $('.page-template-blog-template .inner-blogpost-info').each(function(i){
                  var tHt = $(this).height();
                  if(ht<tHt){
                    ht=tHt;
                  }
                });
                $('.page-template-blog-template .inner-blogpost-info').height(ht+'px');
              }
              innerblogpostHeight();
            });
            $( window ).resize(function(){
              innerblogpostHeight();
            });
          </script>
       </div> 
       <?php
   endwhile;
endif;
wp_reset_postdata();
?>
<div class="clearfix"></div>

</div>
<?php } if (get_theme_mod('luzuk__blog_layout') == '2' ) { ?>

    <div id="blog-box" class="ht-blog-wrap innerpage-whitebox col-md-9">
      <?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 wow zoomIn">
                   <div class="inner-blogpost">
                   <div class="col-md-6 col-sm-6 col-xs-12">                  
                    <?php
                        if(get_theme_mod('blog_featured_img_on_off') != 'on' ){
                      ?>
                     <div class="ht-blog-thumbnail">
                       <a href="<?php the_permalink(); ?>">
                          <img class="inner-blog-img" src="<?php echo $img; ?>" alt="<?php the_title(); ?>" style="height: <?php echo esc_attr(get_theme_mod('dinero_blogpage_post_image_height','350')) ?>px;">
                      </a>
                     <div class="overlay"></div>
                       <?php if (get_theme_mod('dinero_show_date',true) != false){ ?>
                          <div class="blog-date"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo get_the_date( 'j F, Y' ); ?></div>
                        <?php }?>
                    </div>
                    <?php } ?>
                      <?php if (get_theme_mod('dinero_show_category',true) != false){ ?>
                        <div class="blog-category"> 
                          <span><i class="fa fa-file-o" aria-hidden="true"></i><?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?></span>
                        </div>
                      <?php }?>
                      <?php if (get_theme_mod('dinero_show_tags',true) != false){ ?>
                          <div class="blog-tags">
                            <i class="fa fa-tags" aria-hidden="true"></i>
                            <?php
                                  if( $tags = get_the_tags() ) {
                                    foreach( $tags as $content_tag ) {
                                      $sep = ( $content_tag === end( $tags ) ) ? '' : ' ';
                                      echo '<a href="' . esc_url(get_term_link( $content_tag, $content_tag->taxonomy )) . '" class="ml-2 mb-2">' . esc_html($content_tag->name) . '</a>' . esc_html($sep);
                                    }
                                  } ?>
              
                            </div>
                      <?php }?>
                  </div>
                   <div class="col-md-6 col-sm-6 col-xs-12"> 
                    <div class="inner-blogpost-info">
                     
                       <div class="blog-info-area"> 

                         <?php if (get_theme_mod('dinero_show_author',true) != false || get_theme_mod('dinero_show_time',true) != false || get_theme_mod('dinero_show_comments',true) != false){ ?>
                            <ul class="metabox"> 
                              <?php if (get_theme_mod('dinero_show_comments',true) != false){ ?>
                                  <li class="blog-comment"> <i class="fa fa-comment-o" aria-hidden="true"></i> Comment :  <?php echo $my_var = get_comments_number(); ?></li>
                              <?php }?>

                              <?php if (get_theme_mod('dinero_show_author',true) != false){ ?>
                               <li class="blog-author"><i class="fa fa-user" aria-hidden="true"></i> By <?php echo get_the_author(); ?> 
                              </li>
                              <?php }?>
                             
                               <?php if (get_theme_mod('dinero_show_time',true) != false){ ?>
                                <li class="blog-time"><i class="fa fa-clock-o" aria-hidden="true"></i><?php echo the_time( 'g:i a' ) ?></li>
                              <?php }?>                            
                               <div class="clearfix"></div>
                            </ul>
                          <?php }?>                         
                        </div>
                        <div class="clearfix"></div>
                          <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                          <div class="inner-blog-excerpt">
                                <?php $dinero_excerpt = get_the_excerpt(); echo esc_html( dinero_string_limit_words( $dinero_excerpt, esc_attr(get_theme_mod('dinero_blogpage_post_excerpt','20')) ) ); ?>

                          </div>

                         <?php
                        $blogbutton = get_theme_mod('blog_page_btn_txt', 'READ MORE'); 
                      ?>

                        <?php if( get_theme_mod('blog_page_button_display','show' ) == 'show') :
                          ?>  
                          <div class="blog-page-btn">
                            <a href="<?php the_permalink(); ?>" target="_blank">      
                             <i class="fa fa-caret-square-o-right" aria-hidden="true"></i> <?php echo ($blogbutton );  ?>
                            </a></div>
                          <?php endif ?>

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

                        <div class="socialMedia">
                          <ul>
                            <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
                            <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php the_title();?>" target="_blank" class="site-button sharp"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
                            
                            <li><a href="https://twitter.com/share?url=<?php the_permalink();?>&amp;text=<?php the_title();?>" class="site-button sharp" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
                            <li><a href="http://www.digg.com/submit?url=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-digg" aria-hidden="true"></i></a></li>
                            <li class="share-button"><a href="#" class="site-button sharp"><i class="fa fa-share-alt"></i></a></li>
                          </ul>
                            <div class="clearfix"></div>
                        </div>
                    <?php } ?>

                   

                   <div class="clearfix"></div>
                 </div>
               </div>
                   
               
                   <div class="clearfix"></div> 
                   
           </div>
              <script>
            jQuery.noConflict();
            $(function(){
              function innerblogpostHeight(){
                var ht = 0;
                $('.page-template-blog-template .inner-blogpost-info').each(function(i){
                  var tHt = $(this).height();
                  if(ht<tHt){
                    ht=tHt;
                  }
                });
                $('.page-template-blog-template .inner-blogpost-info').height(ht+'px');
              }
              innerblogpostHeight();
            });
            $( window ).resize(function(){
              innerblogpostHeight();
            });
          </script>
       </div> 
       <?php
   endwhile;
endif;
wp_reset_postdata();
?>
<div class="clearfix"></div>

</div>
    <div class="col-md-3">
      <div id="secondary" class="widget-area">
        <?php dynamic_sidebar('luzuk-blog-sidebar'); ?>
      </div>
    </div>


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