<?php
/**
 * Services Section
 *
 * @package Construction_Landing_Page
 */

$section_title   = get_theme_mod('construction_landing_page_services_section_title');
$section_content = get_theme_mod('construction_landing_page_services_section_description');
$post_one        = get_theme_mod('construction_landing_page_services_post_one');
$post_two        = get_theme_mod('construction_landing_page_services_post_two');
$post_three      = get_theme_mod('construction_landing_page_services_post_three');
$post_four       = get_theme_mod('construction_landing_page_services_post_four');
$post_five       = get_theme_mod('construction_landing_page_services_post_five');
$post_six        = get_theme_mod('construction_landing_page_services_post_six');
$post_seven      = get_theme_mod('construction_landing_page_services_post_seven');
$post_eight      = get_theme_mod('construction_landing_page_services_post_eight');

$posts = array($post_one, $post_two, $post_three, $post_four, $post_five, $post_six, $post_seven, $post_eight);
$posts = array_diff(array_unique($posts), array(''));

if ($section_title || $section_content || $posts) {

	?>
	<section class="our-services">
	    <div class="container">

	<?php

	construction_landing_page_get_section_header($section_title, $section_content);

	$qry = new WP_Query(array(
			'post_type'           => 'post',
			'posts_per_page'      => -1,
			'post__in'            => $posts,
			'orderby'             => 'post__in',
			'ignore_sticky_posts' => true
		));

	if ($posts && $qry->have_posts()) {?>
		<div class="row">
		<?php while ($qry->have_posts()) {
			$qry->the_post();?>
			<div class="col">
			                            <div class="holder">

			<?php if (has_post_thumbnail()) {?>
				                                    <div class="icon-holder"><?php the_post_thumbnail('full');?></div>
				<?php }?>

			                                <h3 class="title"><a href="<?php the_permalink();?>"><?php the_title();
			?></a></h3>

			<?php the_excerpt();?>
			</div>
			                        </div>
			<?php
		}
		wp_reset_postdata();
		?></div>
		<?php
	}
	?>
	</div>
	</section>

	<?php
}