<?php
/**
 * Template part for home page content
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage xrprompt
 * @since 1.0
 * @version 1.1
 */
?> 
<?php if(have_posts()) : while(have_posts()) : the_post() ;?>

<section class="faq-section" <?php if(get_field('page_background_image')) : ?> style="background-image:url(<?php echo get_field('page_background_image') ?>)" <?php endif; ?>>

	<div class="container">

		<h1><?php the_title(); ?></h1>

		<?php if( have_rows('faq_set') ): ?>

			<div id="accordion" class="faq-content">

				<?php while ( have_rows('faq_set') ) : the_row(); ?>

	            <h3><?php the_sub_field('question');?></h3>

	            <div class="faqcont"><?php the_sub_field('answer'); ?></div>

    			<?php endwhile; ?>
    		</div>

    		<?php else : endif; ?>
		 
	</div> 
</section>

<?php endwhile; endif; ?>