<?php
/**
 * The template part for displaying the testimonials section on homepage
 *
 * @package Meridian One
 * @since 1.0
 */
?>
<?php

	$title = false;
	$subtitle = false;
	$count_num = false;
	$count_text = false;

	if ( meridian_one_get_theme_option( 'home_testimonials_section_title' ) ) {
		$title = meridian_one_get_theme_option( 'home_testimonials_section_title' );
	}

	if ( meridian_one_get_theme_option( 'home_testimonials_section_subtitle' ) ) {
		$subtitle = meridian_one_get_theme_option( 'home_testimonials_section_subtitle' );
	}

	if ( meridian_one_get_theme_option( 'home_testimonials_customers_count_num' ) ) {
		$count_num = meridian_one_get_theme_option( 'home_testimonials_customers_count_num' );
	}

	if ( meridian_one_get_theme_option( 'home_testimonials_customers_count_text' ) ) {
		$count_text = meridian_one_get_theme_option( 'home_testimonials_customers_count_text' );
	}

?>
<div id="testimonials" class="section section-testimonials">

	<div class="wrapper">

		<?php if ( $title || $subtitle || $description ) : ?>
			<div class="section-header">
				<?php if ( $title ) : ?>
					<h2 class="section-title"><?php echo esc_html( $title ); ?></h2>
				<?php endif; ?>
				<?php if ( $subtitle ) : ?>
					<h3 class="section-subtitle"><?php echo esc_html( $subtitle ); ?></h3>
				<?php endif; ?>
			</div><!-- .section-header -->
		<?php endif; ?>

		<?php if ( $count_num && $count_text ) : ?>
			<div class="section-testimonials-customer-count">
				<div class="section-testimonials-customer-count-inner">
					<span><?php echo esc_html( $count_num ); ?></span>
					<strong><?php echo str_replace( '/', '<br>', esc_html( $count_text ) ); ?></strong>
				</div><!-- .section-testimonials-customer-count-inner -->
			</div><!-- .section-testimonials-customer-count -->
		<?php endif; ?>

	</div><!-- .wrapper -->

	<?php if ( is_active_sidebar( 'sidebar-home-testimonials' ) ) : ?>
		<div class="section-testimonials-items no-col-spacing clearfix">
			<?php dynamic_sidebar( 'sidebar-home-testimonials' ); ?>
		</div><!-- .section-testimonials-items -->	
	<?php endif; ?>

</div><!-- .section-testimonials -->