<?php
   if ( ! defined( 'ABSPATH' ) ) {
     exit; // Exit if accessed directly
   }
?>
<?php get_header(); ?>
<?php $template_url = get_bloginfo ( 'template_url' ) . '/'; ?>
<?php 
//to check if there is a post regarding the url access the page
//to check if there is a post regarding the url access the page
   if (have_posts ()) :
     the_post(); 
   endif;
   $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'thumbnail' );
   if($url != "")
   {
   $img = $url; 
   }else{
   $img = $template_url."img/breatcome_bg.jpg"; 
   } 
?>
<!-- Start Breadcrumbs -->
<div class="breadcrumbs overlay" style="background-image:url(<?=$img?>)">
   <div class="container">
      <div class="bread-inner">
         <div class="row">
            <div class="col-12">
               <h2><?php the_title();?></h2>
               <ul class="bread-list">
                  <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Home</a></li>
                  <li><i class="icofont-simple-right"></i></li>
                  <li class="active"><?php the_title();?></li>
               </ul>
            </div>
         </div>
      </div>
   </div>
</div>
<!-- End Breadcrumbs -->
<section class="Feautes section" id="popularquestions">
      <div class="container">
        <div class="row">
          <div class="col-lg-12">
            <div class="section-title">
              <?php the_content();?>
            </div>
          </div>
          <div class="col-lg-12 col-md-12 col-sm-12 col-12">
            <div class="accordionWrapper">
               <?php
                    $args = array ( 
                        'post_type'      => 'faq',
                        'post_status'    => 'publish',  
                        'orderby' => 'publish_date',
                        'order' => 'DESC',  
                        'posts_per_page' => -1
                    );
                    $query = new WP_Query($args);
                    $post_count = $query->post_count;
                    if ( $query->have_posts() ){
                    $i = 1;
                      while ( $query->have_posts() ){
                        $query->the_post();
                        $img_url = get_the_post_thumbnail_url( get_the_ID(),'full');
                        $post = get_post(get_the_ID());
               ?> 
              <div class="accordionItem <?php if($i==1){?> open <?php }else{ ?> close <?php } ?>">
                <h2 class="accordionItemHeading"><?php echo get_the_title();?></h2>
                <div class="accordionItemContent">
                  <?php echo get_the_content();?>
                </div>
              </div>
                  <?php
                   $i++;
                  }
                }wp_reset_postdata();
                ?>
            </div>
          </div>
        </div>
      </div>
    </section>
<?php get_footer(); ?>