<?php if ( !defined( 'ABSPATH' ) ) exit();

get_header();


$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;

$number_column = get_theme_mod( 'ova_team_layout', 'four_column' );


?>

<div class="container">
	<div class="row">
		<div class="archive_team <?php echo esc_attr( $number_column ) ?>">
			<div class="content">
				<?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>

					<div class="items elementor-items">
						<?php 

						$id = get_the_id();

						$avatar = get_post_meta( $id, 'ova_team_met_avatar', true );
						$job = get_post_meta( $id, 'ova_team_met_job', true );
						$email = get_post_meta( $id, 'ova_team_met_email', true );
						$phone = get_post_meta( $id, 'ova_team_met_phone', true );
						$list_social = get_post_meta( $id, 'ova_team_met_group_icon', true );
						?>

						<div class="content_info">
							<div class="ova-media">
								<?php if( ! empty( $avatar ) ){ ?>
									<a href="<?php echo get_the_permalink() ?>">
										<img src="<?php echo esc_url( $avatar ) ?>" class="img-responsive" alt="<?php echo get_the_title() ?>">
									</a>
									
								<?php } ?>
							</div>
							<div class="ova-info-content">

								<?php if( ! empty( $list_social ) ) { ?>
								<div class="ova-social">
									<ul>
										<?php 
										foreach( $list_social as $social ){

											$class_icon = isset( $social['ova_team_met_class_icon_social'] ) ? $social['ova_team_met_class_icon_social'] : '';
											$link_social = isset( $social['ova_team_met_link_social'] ) ? $social['ova_team_met_link_social'] : '';
											?>
											<li>
												<a href="<?php echo esc_url( $link_social ) ?>">
													<i class="<?php echo esc_attr( $class_icon ) ?>"></i>
												</a>
											</li>
											<?php
										}
										?>
									</ul>
								</div>
								<?php } ?>

								<a href="<?php echo get_the_permalink() ?>" class="name second_font" >
									<?php echo get_the_title() ?>
								</a>

								<?php if( ! empty( $job ) ) { ?>
									<p class="job">
										<?php echo esc_html( $job ) ?>
									</p>
								<?php } ?>

								<?php if( ! empty( $email ) ) { ?>
									<div class="ova-email">
										<i class="fa fa-envelope-o"></i>
										<a href="mailto:<?php echo esc_attr( $email ) ?>" ><?php echo esc_html( $email ) ?></a>
									</div>
								<?php } ?>
								<?php if( ! empty( $phone ) ) { ?>
									<div class="ova-phone">
										<i class="fa fa-phone"></i>
										<a href="tel:<?php echo esc_attr( $phone ) ?>" ><?php echo esc_html( $phone ) ?></a>
									</div>
								<?php } ?>

								

							</div>
						</div>

					</div>

				<?php endwhile; endif; wp_reset_postdata(); ?>
			</div>
			
			<?php 
				egovt_pagination_theme();
			?>

		</div>
	</div>
</div>

<?php 
 get_footer();