<?php

// Prevent Direct Access
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$background = get_theme_mod('testimonials_background');
$testimonials = get_theme_mod('testimonials', array());
$section_id = get_theme_mod('testimonials_menu_id', 'testimonials');
?>

<section id="<?php echo $section_id ?>" class="parallax-bg parallax padding" <?php if($background){ echo 'style="background-image:url('.wp_get_attachment_url($background).');"'; } ?>>
	<div class="container text-center">
		<div class="row">
			<div class="col-sm-10 col-md-8 col-sm-offset-1 col-md-offset-2">
				<div class="testimonials-container">
					<div class="swiper-wrapper">
						
						<?php foreach($testimonials as $testimonial){ ?>
						<div class="swiper-slide">
							<?php
							if( $testimonial['text'] != '' ){ echo '<p class="testimonial_text"><i class="fa fa-quote-'.(is_rtl() ? 'right' : 'left').'"></i> '.nl2br($testimonial['text']).' <i class="fa fa-quote-'.(is_rtl() ? 'left' : 'right').'"></i></p>'; }
							if( $testimonial['name'] != '' ){ echo '<span class="testimonial_name">'.$testimonial['name'].'</span>'; }
							if( $testimonial['job_position'] != '' ){ echo '<span class="testimonial_position">'.$testimonial['job_position'].'</span>'; }
							?>
						</div>
						<?php } ?>
						
					</div>
				</div>
			</div>
		</div>
	</div>
</section>