<?php if ( true == get_theme_mod( 'gym_workout_team_on_off', 'off' ) ) : ?>

<?php 

$team_count = get_theme_mod('gym_workout_team_count');
$gym_workout_team_extra_heading = get_theme_mod('gym_workout_team_extra_heading');
$gym_workout_team_main_heading = get_theme_mod('gym_workout_team_main_heading');

?>

<section id="home_team" class="py-5">
	<div class="container">
		<div class="text-center mb-4">
			<?php if ( ! empty( $gym_workout_team_extra_heading ) ) : ?>
				<p class="extraheading"><?php echo esc_html( $gym_workout_team_extra_heading ); ?></p>
			<?php endif; ?>
			<?php if ( ! empty( $gym_workout_team_main_heading ) ) : ?>
				<h3><?php echo esc_html( $gym_workout_team_main_heading ); ?></h3>
				<hr>
			<?php endif; ?>
		</div>
		<div class="team_main_box">
			<div class="owl-carousel">
				<?php for ($i=1; $i <= $team_count; $i++) {
					$gym_workout_team_image = get_theme_mod('gym_workout_team_image'.$i);
					$gym_workout_team_member_name = get_theme_mod('gym_workout_team_member_name'.$i);
					$gym_workout_team_member_link = get_theme_mod('gym_workout_team_member_link'.$i); 
					$gym_workout_team_designation = get_theme_mod('gym_workout_team_designation'.$i);
					$gym_workout_team_social_icon_1_feild = get_theme_mod('gym_workout_team_social_icon_1_feild'.$i);
					$gym_workout_team_social_link_1_feild = get_theme_mod('gym_workout_team_social_link_1_feild'.$i);
					$gym_workout_team_social_icon_2_feild = get_theme_mod('gym_workout_team_social_icon_2_feild'.$i);
					$gym_workout_team_social_link_2_feild = get_theme_mod('gym_workout_team_social_link_2_feild'.$i);
					$gym_workout_team_social_icon_3_feild = get_theme_mod('gym_workout_team_social_icon_3_feild'.$i);
					$gym_workout_team_social_link_3_feild = get_theme_mod('gym_workout_team_social_link_3_feild'.$i);
					$gym_workout_team_social_icon_4_feild = get_theme_mod('gym_workout_team_social_icon_4_feild'.$i);
					$gym_workout_team_social_link_4_feild = get_theme_mod('gym_workout_team_social_link_4_feild'.$i);
					$gym_workout_team_social_icon_5_feild = get_theme_mod('gym_workout_team_social_icon_5_feild'.$i);
					$gym_workout_team_social_link_5_feild = get_theme_mod('gym_workout_team_social_link_5_feild'.$i); ?>
					<div class="team_content_box text-center">
						<?php if ( ! empty( $gym_workout_team_image ) ) : ?>
							<img src="<?php echo esc_url( $gym_workout_team_image ); ?>">
						<?php endif; ?>
						<div class="team_content_inner_box">
							<?php if ( ! empty( $gym_workout_team_member_name ) ) : ?>
								<h4><a href="<?php echo esc_url( $gym_workout_team_member_link ); ?>"><?php echo esc_html( $gym_workout_team_member_name ); ?></a></h4>
							<?php endif; ?>
							<?php if ( ! empty( $gym_workout_team_designation ) ) : ?>
								<p class="mb-0"><?php echo esc_html( $gym_workout_team_designation ); ?></p>
							<?php endif; ?>
							<div class="media-links mt-2">
								<?php if ( ! empty( $gym_workout_team_social_icon_1_feild ) || ! empty( $gym_workout_team_social_link_1_feild ) ): ?>
									<a href="<?php echo esc_url( $gym_workout_team_social_link_1_feild ); ?>">
										<span class="dashicons dashicons-<?php echo esc_html( $gym_workout_team_social_icon_1_feild ); ?>"></span>
									</a>
								<?php endif; ?>
								<?php if ( ! empty( $gym_workout_team_social_icon_2_feild ) || ! empty( $gym_workout_team_social_link_2_feild ) ): ?>
									<a href="<?php echo esc_url( $gym_workout_team_social_link_2_feild ); ?>">
										<span class="dashicons dashicons-<?php echo esc_html( $gym_workout_team_social_icon_2_feild ); ?>"></span>
									</a>
								<?php endif; ?>
								<?php if ( ! empty( $gym_workout_team_social_icon_3_feild ) || ! empty( $gym_workout_team_social_link_3_feild ) ) : ?>
									<a href="<?php echo esc_url( $gym_workout_team_social_link_3_feild ); ?>">
										<span class="dashicons dashicons-<?php echo esc_html( $gym_workout_team_social_icon_3_feild ); ?>"></span>
									</a>
								<?php endif; ?>
								<?php if ( ! empty( $gym_workout_team_social_icon_4_feild ) || ! empty( $gym_workout_team_social_link_4_feild ) ) : ?>
									<a href="<?php echo esc_url( $gym_workout_team_social_link_4_feild ); ?>">
										<span class="dashicons dashicons-<?php echo esc_html( $gym_workout_team_social_icon_4_feild ); ?>"></span>
									</a>
								<?php endif; ?>
								<?php if ( ! empty( $gym_workout_team_social_icon_5_feild ) || ! empty( $gym_workout_team_social_link_5_feild ) ) : ?>
									<a href="<?php echo esc_url( $gym_workout_team_social_link_5_feild ); ?>">
										<span class="dashicons dashicons-<?php echo esc_html( $gym_workout_team_social_icon_5_feild ); ?>"></span>
									</a>
								<?php endif; ?>
							</div>
						</div>
					</div>
				<?php } ?>
			</div>
		</div>
	</div>
</section>

<?php endif; ?>