
		<!-- map block
			================================================== -->
		<div class="map-wrapper">
			<div id="map" data-map-zoom="9"></div>
		</div>
		<!-- End map block -->

		<!-- explore-module
			================================================== -->
		<section class="explore">
			<div class="container">
				<div class="row">
					<div class="col-lg-8">
						<div class="explore__box" id="ex-wrap">
							<h2 class="heading2 explore__filter-title">
						<?php
						if ( is_post_type_archive() ) {
						    ?>
						    <span><?php esc_html_e('Results For','triptip'); ?>:</span> <?php post_type_archive_title(); ?>
						    <?php
						}else{
						?>
							<span><?php esc_html_e('Results For', 'triptip'); ?>:</span> <?php esc_html_e('Trending Listings', 'triptip'); ?>
						<?php } ?>
						<a href="<?php echo get_post_type_archive_link('listing'); ?>" class="active list-style">
							<i class="fa fa-list-ul" aria-hidden="true"></i>
						</a>
						<a href="<?php echo get_post_type_archive_link('listing'); ?>?layout=fullmap" class="full-style">
							<i class="fa fa-th" aria-hidden="true"></i>
						</a>
					</h2>
					<?php if(is_search()){ ?>
							<?php 
								$q = sanitize_text_field( $_GET['s'] );// get the searched query
						        $cat = !empty($_GET['in_cat']) ? sanitize_text_field($_GET['in_cat']) : 'all';
						        $loc = !empty($_GET['in_loc']) ? sanitize_text_field($_GET['in_loc']) : 'all';
						        $args = array(
								    'post_type'     => 'listing',
								    'post_status'   => 'publish',
								    's'             => $q,
								);
						        $tax_queries=array();

								if( $cat!='all') {
								      /*@todo; add option to the settings panel to let user choose whether to include result from children or not*/
								      $tax_queries[] = array(
								          'taxonomy'         => 'listing-category',
								          'field'            => 'slug',
								          'terms'            => $cat,
								          'include_children' => true, /*@todo; Add option to include children or exclude it*/
								      );

								}

								if( $loc!='all' ) {
							        /*@todo; add option to the settings panel to let user choose whether to include result from children or not*/
							        $tax_queries[] = array(
							          'taxonomy'         => 'listing-region',
							          'field'            => 'slug',
							          'terms'            => $loc,
							          'include_children' => true, /*@todo; Add option to include children or exclude it*/
							        );

								}

								if (!is_empty_v($tax_queries)){
								   $args['tax_query'] = $tax_queries;
								}
								  
								 $listings = new WP_Query($args);
							?>
							<div class="explore__wrap iso-call">
								<?php 
									$locations = array();

			                        if($listings->have_posts()) :
			                            while($listings->have_posts()) : $listings->the_post();

			                            $locations[] = array(get_the_permalink(),get_the_post_thumbnail_url('thumbnail'),get_the_title(), 'Coffee', 'Closed', '457 Court St, Brooklyn', '2', '7.9');
			                    ?>

										<div class="item">

											<!-- place-post module -->
											<div class="place-post">
												<div class="place-post__gal-box">
													<?php the_post_thumbnail('', ['class' => 'place-post__image']); ?>
													<?php triptip_post__ratings_get_average(get_the_ID()); ?>
													
													<?php if( function_exists('get_simple_likes_button') ) echo get_simple_likes_button(get_the_ID());?>
												</div>
												<div class="place-post__content">
													<?php if( function_exists('qkl_working_status') ){ qkl_working_status(); } ?>
													<h2 class="heading2 place-post__title">
														<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
													</h2>
													<p class="place-post__description">
														<?php 
															if( function_exists('qkl_listing_category') ){ qkl_listing_category(get_the_ID()); }
														?>
														
														<?php if( function_exists('triptip_price_range') ){  triptip_price_range(); }  ?>
														
														<span class="place-post__description-review">
															<i class="fa fa-comment-o" aria-hidden="true"></i>
															<?php comments_number( esc_html__('0 Reviews','triptip'), esc_html__('1 Review','triptip'), esc_html__('% Reviews','triptip') ); ?>
														</span>
													</p>
													<?php if(get_post_meta(get_the_ID(), '_triptip_address',true)!=''){ ?>
													<p class="place-post__address">
														<i class="fa fa-map-marker" aria-hidden="true"></i>
														<?php echo esc_html(get_post_meta(get_the_ID(), '_triptip_address',true)) ?>
													</p>
													<?php } ?>
												</div>
											</div>
											<!-- end place-post module -->
											
										</div>	

								<?php endwhile; ?>
								<?php else : ?>
								    <div class="blog-post not-found">
								      <div class="alert alert-danger" role="alert">
								        <strong><?php esc_html_e('Nothing Found Here!','triptip'); ?></strong> <?php esc_html_e('Search with other keyword:', 'triptip') ?>
								      </div>
								    </div>
								<?php endif; ?>
							</div>

							<?php if($listings->found_posts>0){ ?>
								<div class="center-button">
									<a class="btn-default btn-default-red load-more" 
										data-cat="<?php echo esc_attr('all'); ?>" 
										data-loc="<?php echo esc_attr('all'); ?>" 
										data-load="<?php echo get_option( 'posts_per_page' ); ?>" 
										data-found="<?php echo esc_attr($listings->found_posts); ?>"
										data-layout="list"
										href="#">
										<i class="fa fa-refresh"></i>
										<?php esc_html_e('Load More Listing', 'triptip'); ?>
									</a>
								</div>
							<?php } ?>

						<?php }else{ ?>

							<div class="explore__wrap iso-call list-version">
								<?php
			                        $i=1; if(have_posts()) :
			                          		while(have_posts()) : the_post(); 
			                    ?>
								<div class="item">

									<!-- place-post module -->
									<div class="place-post list-style">
										<div class="place-post__gal-box">
											<?php the_post_thumbnail('', ['class' => 'place-post__image']); ?>
											<?php triptip_post__ratings_get_average(get_the_ID()); ?>
											<?php if( function_exists('get_simple_likes_button') ) echo get_simple_likes_button(get_the_ID());?>
										</div>
										<div class="place-post__content">
											<?php if( function_exists('qkl_working_status') ){ qkl_working_status(); } ?>
											<h2 class="heading2 place-post__title">
												<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
											</h2>
											<p class="place-post__description">
												<?php 
													if( function_exists('qkl_listing_category') ){ qkl_listing_category(get_the_ID()); }
												?>
												<?php if( function_exists('triptip_price_range') ){  triptip_price_range(); }  ?>

												<span class="place-post__description-review">
													<i class="fa fa-comment-o" aria-hidden="true"></i>
													<?php comments_number( esc_html__('0 Reviews','triptip'), esc_html__('1 Review','triptip'), esc_html__('% Reviews','triptip') ); ?>
												</span>
											</p>
											<p class="place-post__text">
												<?php echo triptip_excerpt($limit = 20); ?>
											</p>
											<?php if(get_post_meta(get_the_ID(), '_triptip_address',true)!=''){ ?>
												<p class="place-post__address">
													<i class="fa fa-map-marker" aria-hidden="true"></i>
													<?php echo esc_html(get_post_meta(get_the_ID(), '_triptip_address',true)) ?>
												</p>
											<?php } ?>
										</div>
									</div>
									<!-- end place-post module -->
									
								</div>	

								<?php $i++; endwhile; ?>
								<?php else : ?>
								    <div class="blog-post not-found">
								      <div class="alert alert-danger" role="alert">
								        <strong><?php esc_html_e('Nothing Found Here!','triptip'); ?></strong> <?php esc_html_e('Search with other keyword:', 'triptip') ?>
								      </div>
								    </div>
								<?php endif; ?>

							</div>
							
							<?php if($wp_query->found_posts>0){ ?>
								<div class="center-button">
									<a class="btn-default btn-default-red load-more" 
										data-cat="<?php echo esc_attr('all'); ?>" 
										data-loc="<?php echo esc_attr('all'); ?>" 
										data-load="<?php echo get_option( 'posts_per_page' ); ?>" 
										data-found="<?php echo esc_attr($wp_query->found_posts); ?>"
										data-layout="list"
										href="#">
										<i class="fa fa-refresh"></i>
										<?php esc_html_e('Load More Listing', 'triptip'); ?>
									</a>
								</div>
							<?php } ?>

							<?php } ?>
						</div>
					</div>

					<div class="col-lg-4">
						<div class="explore__filter">
							<?php echo do_shortcode('[advancesearch_listing]'); ?>

							<?php 
								if(is_active_sidebar('sidebar-list')){
									dynamic_sidebar('sidebar-list'); 
								}
							?>
							
						</div>
					</div>

				</div>
			</div>
		</section>
		<!-- End explore-module -->
