<?php
/**
 * Template Name: Custom Home
 */

get_header(); ?>

<main id="skip-content" role="main">

	<?php do_action( 'forest_adventure_tour_above_slider' ); ?>

	<?php if( get_theme_mod('forest_adventure_tour_slider_hide_show') != ''){ ?>

	<div id="ht-home-slider-section">
		<div id="big" class="owl-carousel owl-theme">
			<?php $forest_adventure_tour_slider_pages = array();
				for ( $count = 1; $count <= 3; $count++ ) {
					$mod = intval( get_theme_mod( 'forest_adventure_tour_slider'. $count ));
					if ( 'page-none-selected' != $mod ) {
						$forest_adventure_tour_slider_pages[] = $mod;
					}
				}
				if( !empty($forest_adventure_tour_slider_pages) ) :
					$args = array(
						'post_type' => 'page',
						'post__in' => $forest_adventure_tour_slider_pages,
						'orderby' => 'post__in'
					);
					$query = new WP_Query( $args );
				if ( $query->have_posts() ) :
					$i = 1;
			?>    

			<?php  while ( $query->have_posts() ) : $query->the_post(); ?>
					<div class="item">
						<div class="sliderimg ">
							<img src="<?php echo esc_url(get_the_post_thumbnail_url(get_the_ID(), 'full')); ?>" alt="<?php the_title_attribute(); ?>" />
							<div class="slider-gride"></div>
						</div>
						<?php
							$forest_adventure_tour_slider_effect = get_theme_mod('forest_adventure_tour_slider_effect', '') 
						?>			        
						<div class="ht-slide-caption <?php echo ($forest_adventure_tour_slider_effect); ?>">
						<div class="ht-slide-cap-title"><?php
						$forest_adventure_tour_title = get_the_title();
						echo esc_html(forest_adventure_tour_string_limit_words($forest_adventure_tour_title, esc_attr(get_theme_mod('forest_adventure_tour_slider_excerpt_length', '15'))));
						?></div>
						</div>
					</div>
				<?php $i++; endwhile; wp_reset_postdata();?>
			<?php else : ?>
				<div class="no-postfound"></div>
			<?php endif; endif;?>
		</div>
		<div class="thumb-area">
			<div class="container pd-0">
				<div class="row">
					<div class="col-md-5 col-sm-1">
					</div>
					<div class="col-md-7 col-sm-11 col-xs-12">
						<div class="thumb-slide">
							<div class="thumb-content">
								<div id="thumbs" class="owl-carousel owl-theme">
									<?php
										 $args = array('post_type' => 'slider');
									    while ($query->have_posts()) : $query->the_post();
									      $slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
									      $id = get_the_ID();
						 			?>
									  <div class="item" data-item="0">
									  	<div class="thumb-img">
									  		<?php
							                    if (has_post_thumbnail()) {
							                      $image_url = $slider_image[0];
							                    } else {
							                      $image_url = get_template_directory_uri() . '/images/default.png';
							                    }
							                ?>
							                <img  src="<?php echo esc_url($image_url); ?>" alt="<?php the_title_attribute(); ?>" />
									  	</div>
									  </div>
						 			<?php
									    endwhile;
									?>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<?php }?>

	<?php do_action('forest_adventure_tour_below_slider'); ?>

	<section id="aboutus-section" >
		<div class="container"> 
			<div class="row "> 
				<div class="col-lg-6 col-md-12 col-sm-12">
					<div class="aboutus-image">
						<div class="abtimg-brd"></div>
						<?php 
							$forest_adventure_tour_aboutus_rightimage = get_theme_mod('forest_adventure_tour_aboutus_rightimage');

							if(!empty($forest_adventure_tour_aboutus_rightimage)){
								echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($forest_adventure_tour_aboutus_rightimage).'" class="img-responsive secondry-bg-img" />';
							}else{
								echo '<img alt="forest_adventure_tour_aboutus_rightimage" src="'.get_template_directory_uri().'/assets/images/default.png" class="img-responsive" />';
							}
						?>
						<div class="aboutus-imgbox"> 
							<div class="imgbx-bg"></div>
							<div class="imgbx-blr"></div>

							<div class="row mr-0"> 
								<div class="col-md-6 col-sm-6">
									<div class="tmbxinn ">
										<div class="row mr-0"> 
											<div class="col-lg-4 col-md-4 col-sm-12 pd-0">
												<div class="hi-iconinn">
													<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M18.4 17.6C26 10 14 3 3 3c0 11 7 23 14.6 15.4L6 6l12.4 11.6zM21 20l-2.6-2.4-.4.4-.4.4L20 21c1 1 2 0 1-1z"></path></g></svg>
													<i class="<?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_imgoverlay_box1_icon',__('fas fa-money-bill-alt','forest-adventure-tour'))); ?>"></i>
												</div>
											</div>
											<div class="col-lg-8 col-md-8 col-sm-12">
												<div class="num"><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_imgoverlay_box1_number')); ?></div>
												<div class="title"><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_imgoverlay_box1_text')); ?></div>
											</div>
										</div>
									</div>
								</div>
								<div class="col-md-6 col-sm-6">
									<div class="tmbxinn">
										<div class="row mr-0">
											<div class="col-lg-4 col-md-4 col-sm-12 pd-0">
												<div class="hi-iconinn">
													<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M18.4 17.6C26 10 14 3 3 3c0 11 7 23 14.6 15.4L6 6l12.4 11.6zM21 20l-2.6-2.4-.4.4-.4.4L20 21c1 1 2 0 1-1z"></path></g></svg>
													<i class="<?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_imgoverlay_box2_icon',__('fas fa-money-bill-alt','forest-adventure-tour'))); ?>"></i>
												</div>
											</div>
											<div class="col-lg-8 col-md-8 col-sm-12">
												<div class="num"><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_imgoverlay_box2_number')); ?></div>
												<div class="title"><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_imgoverlay_box2_text')); ?></div>
											</div>
									</div>
								</div>
							</div>
						</div>
						</div>
					</div>
				</div>
				<div class="col-lg-6 col-md-12 col-sm-12">
					<div class="de-box">
						<div class="abtsection-title">
							<div class="abtbrd"></div>
							<h1><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutusheading')); ?></h1>
							<h2><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutustitle')); ?></h2>
						</div>


						<p><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutusdescription')); ?></p>

						<div class="aboutus-box"> 
							<div class="row tmbx mr-0"> 
								<div class="col-lg-2 col-md-2 col-sm-12 pd-0">
									<div class="hi-icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M18.4 17.6C26 10 14 3 3 3c0 11 7 23 14.6 15.4L6 6l12.4 11.6zM21 20l-2.6-2.4-.4.4-.4.4L20 21c1 1 2 0 1-1z"></path></g></svg>
										<i class="<?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_box1_icon',__('fas fa-money-bill-alt','forest-adventure-tour'))); ?>"></i>
									</div>
								</div>
								<div class="col-lg-10 col-md-10 col-sm-12">
									<h2><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_box1_title')); ?></h2>
									<p><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_box1_description')); ?></p>
								</div>
							</div>
							<div class="row tmbx mr-0">
								<div class="col-lg-2 col-md-2 col-sm-12 pd-0">
									<div class="hi-icon">
										<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M18.4 17.6C26 10 14 3 3 3c0 11 7 23 14.6 15.4L6 6l12.4 11.6zM21 20l-2.6-2.4-.4.4-.4.4L20 21c1 1 2 0 1-1z"></path></g></svg>
										<i class="<?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_box2_icon',__('fas fa-money-bill-alt','forest-adventure-tour'))); ?>"></i>
									</div>
								</div>
								<div class="col-lg-10 col-md-10 col-sm-12">
									<h2><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_box2_title')); ?></h2>
									<p><?php echo esc_html(get_theme_mod('forest_adventure_tour_aboutus_box2_description')); ?></p>
								</div>
							</div>
						</div>
					</div>
				</div>		
			</div>
		</div>
	</section>
	
	<?php do_action('forest_adventure_tour_below_aboutus'); ?>

	<?php if( get_theme_mod('forest_adventure_tour_services_category_setting') != '' ){?>
		<section id="service-section" class="py-5">
			<div class="container"> 
				<div class="section-title">
					<div class="secbrd"></div>
					<h1><?php echo esc_html(get_theme_mod('forest_adventure_tour_servicesubheading')); ?></h1>
					<h2><?php echo esc_html(get_theme_mod('forest_adventure_tour_serviceheading')); ?></h2>
				</div>

				<div class="row mr-0">
					<?php $forest_adventure_tour_catData1 =  get_theme_mod('forest_adventure_tour_services_category_setting');
					if($forest_adventure_tour_catData1){ 
						$args = array(
							'post_type' => 'post',
							'category_name' => $forest_adventure_tour_catData1,
							'posts_per_page' => get_theme_mod('forest_adventure_tour_services_number',3)
						);
						
						$i=1; ?>
						<?php $query = new WP_Query( $args );
						if ( $query->have_posts() ) :
							while( $query->have_posts() ) : $query->the_post(); ?>
							<div class="col-lg-4 col-md-4">
								<div class="service-box">
									<div class="ser-img">
										<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>				
										<div class="service-content">
											<a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
											<div class="ser-brd"></div>
											<div class="row mr-0">
												<div class="col-lg-10 col-md-9 col-sm-10 pd-0">
													<p>
														<?php $forest_adventure_tour_excerpt = get_the_excerpt(); echo esc_html( forest_adventure_tour_string_limit_words( $forest_adventure_tour_excerpt,18 ) ); ?> <?php echo esc_html__('..', 'forest-adventure-tour'); ?>	
													</p>
												</div>
												<div class="col-lg-2 col-md-3 col-sm-2">
													<div class="service-btn">
														<a href="<?php the_permalink(); ?>">
															<i class="fa fa-arrow-right"></i></a> 
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>

							<?php $i++; endwhile; 
							wp_reset_postdata(); ?>
						<?php else : ?>
						<div class="no-postfound"></div>
						<?php endif; ?>
					<?php }?>
				</div>
			</div>
		</section>
	<?php }?>

	<?php do_action('forest_adventure_tour_below_services_section'); ?>

	<div class="container">
	  	<?php while ( have_posts() ) : the_post(); ?>
	  		<div class="lz-content">
	        	<?php the_content(); ?>
	        </div>
	    <?php endwhile; // end of the loop. ?>
	</div>
</main>

<?php get_footer(); ?>
