<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site may use a
 * different template.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Seventeen
 * @since 1.0
 * @version 1.0
 */

get_header(); ?>

<div class="middle-section testimonials-page">
	<?php
	while ( have_posts() ) : the_post(); 
		$page_title   = get_the_title();
		$page_content = get_the_content();

		$main_banner = get_field('main_banner_image');
		$main_banner_title = get_field('main_banner_title');
		$page_image = get_the_post_thumbnail();
               
	?>
	<?php if(isset($main_banner) && !empty($main_banner)) { ?>
	<div class="inner-page-banner clearfix">
    	<div class="banner-imgbox"><img src="<?php echo $main_banner; ?>" alt=""></div>
    	<?php if(isset($main_banner_title) && !empty($main_banner_title)) { ?>
    	<div class="banner-content wow fadeIn" data-wow-delay="0.005s">
        	<div class="container">
            	<div class="page-title wow fadeInLeft" data-wow-delay="0.005s">
                	<h1><?php echo $main_banner_title; ?></h1>
                </div>
            </div>
        </div>
        <?php } ?>
    </div>
    <?php } ?>
    
	<!--Internal page Content-->


    <div class="page-content entry-content">
    	<div class="container">
			<div class="content-left-section">
				<?php if(isset($page_title) && !empty($page_title)) { ?>
				<h2 class="wow fadeInLeft" data-wow-delay="0.005s"><?php echo $page_title; ?></h2>
				<?php } ?>
				
				<div class="clearfix wow fadeInUp" data-wow-delay="0.005s">
					<ul class="testimonial-list clearfix">
				<?php
				$pageID = get_option('page_on_front');
				if(have_rows('section3_content',$pageID)) :
					while(have_rows('section3_content',$pageID)) { the_row();
						$iframe_data = get_sub_field('youtube_video_iframe');
						echo '<li><div class="video-box">'.$iframe_data.'</div></li>';
					}
				endif; 
				?>          
					</ul>
				</div>
			</div>
			<?php include 'right-section.php'; ?>
        </div>
    </div>
<?php endwhile; ?>    

<?php get_footer();