<?php 
$welcome_section = get_theme_mod( 'advance_education_pro_radio_faq_enable' );
if ( 'Disable' == $welcome_section ) {
  return;
}
/*welcome us*/
if( get_theme_mod('advance_education_pro_faq_bgcolor') ) {
  $welcome_backg = 'background-color:'.esc_attr(get_theme_mod('advance_education_pro_faq_bgcolor')).';';
}elseif( get_theme_mod('advance_education_pro_faq_bgimage') ){
  $welcome_backg = 'background-image:url(\''.esc_url(get_theme_mod('advance_education_pro_faq_bgimage')).'\')';
}else{
  $welcome_backg = '';
}
$att_style="";
  $image_att = get_theme_mod( 'advance_education_pro_faq_bgimage_attachment',true );
  if ( 'Scroll' == $image_att ) {
    $att_style="section_bg_scroll";
  }else{
    $att_style="section_bg_fixed";
  }  
?>
<section id="faq" style="<?php echo esc_attr($welcome_backg); ?>" class="<?php echo esc_attr($att_style)?>">
  <div class="inner_sec">
    <div class="container">
      <div class="section-heading">
        <?php if(get_theme_mod('advance_education_pro_faq_title') != ''){?>     
          <h3> 
            <?php if(get_theme_mod('advance_education_pro_title_icon')){
              ?> <i class="<?php echo esc_html(get_theme_mod('advance_education_pro_title_icon')) ?>"></i><?php
            }?>
            <?php echo esc_html_e(get_theme_mod('advance_education_pro_faq_title')); ?></h3>
        <?php } ?>
        <?php if(get_theme_mod('advance_education_pro_faq_subtitle') != ''){?>
          <p><?php echo esc_html_e(get_theme_mod('advance_education_pro_faq_subtitle')); ?></p>
        <?php } ?>
      </div>
      <div class="row">
        <div class="col-lg-7 col-md-7 col-sm-12 col-12">
          <div class="about-content">
             <div id="accordion" class="row">
          <?php
            $args = array(
              'post_type' => 'faq',
              'post_status' => 'publish',
              'paged' => $paged,
            );
            $new = new WP_Query($args); 
            $loop_index = 0; $i=1;
            $count =  get_theme_mod('advance_education_pro_faq_slide_number');
                for($i=1, $j=1; $i<=$count; $i++, $j++) {
              if($j>=5){ $j=1; }
                $new->the_post();  ?>
                <div class="panel-group col-md-12 w-100 mb-3">
                  <div class="panel">
                    <div class="panel-heading">
                    <h4 class="panel-title">
                      <a href="#panelBody<?php echo esc_attr($i); ?>" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion"><?php the_title(); ?><i class="fas fa-plus"></i> </a>
                      </h4>
                    </div>
                    <div id="panelBody<?php echo esc_attr($i); ?>" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <p><?php the_content(); ?></p>
                      </div>
                    </div>
                  </div>
                </div>
                <?php  }
               wp_reset_query(); ?>
            </div>
           </div>
          </div> 
          <div class="col-lg-5 col-md-5 col-sm-12 col-12">
            <div>
             <?php if( get_theme_mod('advance_education_pro_faq_section_image',true) != ''){ ?>
             <img src="<?php echo esc_url(get_theme_mod('advance_education_pro_faq_section_image')); ?>" alt="">
              <?php }?>
            </div> 
        </div>        
      </div>
    </div>
    <div class="clearfix"></div>
  </div>
</div>
</section>