<section id="slider-section" class="slider-area home-slider <?php if(esc_attr(get_theme_mod('insurance_company_slider_section_width','Box Width')) == 'Full Width'){ ?>container-fluid pd-0 <?php } elseif(esc_attr(get_theme_mod('insurance_company_slider_section_width','Box Width')) == 'Box Width'){ ?> container <?php }?>">
  <!-- <div class="slideinning"></div> -->
  <!-- start of hero --> 
    <section class="hero-slider hero-style">
        <div class="insurance_companyswiper-container">
            <div class="swiper-wrapper">
              <?php for($p=1; $p<6; $p++) { ?>
              <?php if( get_theme_mod('slider'.$p,false)) { ?>
              <?php $querycolumns = new WP_query('page_id='.get_theme_mod('slider'.$p,true)); ?>
              <?php while( $querycolumns->have_posts() ) : $querycolumns->the_post(); 
                $image = wp_get_attachment_image_src(get_post_thumbnail_id() , true); ?>
              <?php 
                if(has_post_thumbnail()){
                  $img = esc_url($image[0]);
                }
                if(empty($image)){
                  $img = get_template_directory_uri().'/assets/images/default.png';
                }

                $slider_contactusbtnlink = esc_attr(get_theme_mod('slider_contactusbtnlink','#'));
                $slider_contactinfoHeading = esc_attr(get_theme_mod('slider_contactinfoHeading','Free Expert Advice'));
                $slider_contactinfophonenum = esc_attr(get_theme_mod('slider_contactinfophonenum','+012 3456 789'));

              ?>

              <div class="insurance_companyswiper-slide">
                  <div class="insurance_companyslide-inner slide-bg-image">
                      <div class="container">
                          <div class="row">
                              <div class="col-lg-6 S-lhs">
                                  <div class="slidercontent">
                                      <div class="slide-title">
                                          <h2><?php the_title_attribute(); ?></h2>    
                                      </div>     
                                      <div class="slide-text"> 
                                        <?php the_excerpt(); ?>
                                      </div>
                                      <div class="slide-btns">
                                          <a class="ReadMore" href="<?php echo esc_url( get_permalink() ); ?>">
                                            <?php esc_html_e('Read More','insurance-company'); ?>  
                                          </a>
                                          <a class="contactus" href="<?php echo apply_filters('insurancecompany_slider', $slider_contactusbtnlink); ?>">
                                            <?php esc_html_e('Contact Us','insurance-company'); ?>  
                                          </a>
                                      </div>
                                  </div>
                              </div>
                              <div class="col-lg-6 S-rhs">
                                  <div class="sliderimg ">
                                      <img class="slide-mainimg slidershape1" src="<?php echo esc_url($img); ?>" alt="<?php the_title_attribute(); ?>">
                                      <div class="slider-olay"></div>
                                  </div> 
                              </div>
                          </div>
                      
                          <div class="contactinfo">
                              <div class="contactinfobx">
                                  <div class="row">
                                      <div class="icn">
                                         <i class="fa-solid fa-headphones"></i>
                                      </div>
                                      <div class="contctbx">
                                          <h4><?php echo apply_filters('insurancecompany_slider', $slider_contactinfoHeading); ?></h4>
                                          <a href="tel:<?php echo apply_filters('insurancecompany_slider', $slider_contactinfophonenum); ?>">
                                            <?php echo apply_filters('insurancecompany_slider', $slider_contactinfophonenum); ?>    
                                          </a>         
                                      </div>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
              <?php endwhile;
                 wp_reset_postdata(); ?>
              <?php } } ?>
              <div class="clear"></div> 

            </div>
           <!-- swipper controls -->
            <div class="insurance_companyswiper-pagination"></div>
            <div class="insurance_companyswiper-button-next">
                <?php esc_html_e('Next','insurance-company'); ?>
                <!-- <i class="fa-solid fa-arrow-left"></i> -->
            </div>
            <div class="insurance_companyswiper-button-prev">
                <!-- <i class="fa-solid fa-arrow-left"></i> -->
                <?php esc_html_e('Prev','insurance-company'); ?> 
            </div>
        </div>
    </section>
  <!-- end of hero slider -->
</section>


