Resort informatie Weersverwachting Webcams Skipasprijzen Skigebied Nieuws Omgeving
post_content; $post_slug=$post->post_name; $lat = get_field('lat', $parentpage); $lng = get_field('lng', $parentpage); $webcams = json_decode(get_field('webcamapi_data', $parentpage),true); $skipasprijzen=array(); $indebuurt = new WP_Query(array( 'geo_query' => array( 'lat_field' => 'lat', // this is the name of the meta field storing latitude 'lng_field' => 'lng', // this is the name of the meta field storing longitude 'latitude' => $lat, // this is the latitude of the point we are getting distance from 'longitude' => $lng, // this is the longitude of the point we are getting distance from 'distance' => 250, // this is the maximum distance to search 'units' => 'km' // this supports options: miles, mi, kilometers, km ), 'orderby' => 'distance', // this tells WP Query to sort by distance 'order' => 'ASC', 'post_type' => 'resort', 'posts_per_page' => 5, 'post_parent' => 0, 'post_status' => 'publish' //'post__not_in' => array($parentpage) // bewust uit, om ook de hoofd resort pagina mee te nemen query )); /* echo '
';
	print_r($indebuurt);
	echo '
'; */ // Klaarmaken van Array voor prijsvergelijking if( have_rows('prijzen_skipassen', $parentpage) ): while ( have_rows('prijzen_skipassen', $parentpage) ) : the_row(); $aantaldagen = get_sub_field('aantal_dagen'); $skipasprijzen['volwassenen'][$aantaldagen][get_the_title($parentpage)] = get_sub_field('volwassenen'); $skipasprijzen['jeugd'][$aantaldagen][get_the_title($parentpage)] = get_sub_field('jeugd'); $skipasprijzen['kinderen'][$aantaldagen][get_the_title($parentpage)] = get_sub_field('kinderen'); endwhile; endif; if( $indebuurt->have_posts() ){ while ( $indebuurt->have_posts() ) { $indebuurt->the_post(); if( have_rows('prijzen_skipassen', get_the_id()) ): while ( have_rows('prijzen_skipassen', get_the_id()) ) : the_row(); $aantaldagen = get_sub_field('aantal_dagen'); if(get_sub_field('volwassenen')){ $skipasprijzen['volwassenen'][$aantaldagen][get_the_title()] = get_sub_field('volwassenen'); $skipasprijzen['jeugd'][$aantaldagen][get_the_title()] = get_sub_field('jeugd'); $skipasprijzen['kinderen'][$aantaldagen][get_the_title()] = get_sub_field('kinderen'); } endwhile; endif; } } echo'

skipasprijzen '.get_the_title($parentpage).'

'.get_field('skipassen_tekst',$parentpage).'
'.get_field('skikaart')['alt'].'

kosten skipas '.get_the_title($parentpage).'

'; if( have_rows('prijzen_skipassen', $parentpage) ): echo ''; while ( have_rows('prijzen_skipassen', $parentpage) ) : the_row(); echo ''; endwhile; echo '
Skipasprijs hoogseizoenVolwassenenJeugdKinderen
'.aantalDagen(get_sub_field('aantal_dagen')).' €'.number_format_drop_zero_decimals(get_sub_field('volwassenen'), 2).' €'.number_format_drop_zero_decimals(get_sub_field('jeugd'), 2).' €'.number_format_drop_zero_decimals(get_sub_field('kinderen'), 2).'
'; endif; if(get_field('skipassen_toelichting')){ echo ''.get_field('skipassen_toelichting').''; } echo '
'; echo '

volwassenen

'; echo ''; if( $indebuurt->have_posts() ){ while ( $indebuurt->have_posts() ){ $indebuurt->the_post(); if($post->geo_query_distance>0){ echo ''; } else{ echo ''; } } } echo ''; foreach($skipasprijzen['volwassenen'] as $key => $regel){ $i = 0; echo ''; foreach($indebuurt->posts as $test){ if(isset($regel[$indebuurt->posts[$i]->post_title])){ $prijs = $regel[$indebuurt->posts[$i]->post_title]; echo ''; } else{ echo ''; } $i++; } echo ''; } echo '
Skipasprijs hoogseizoen'.get_the_title().' ('.round($post->geo_query_distance).'km)'.get_the_title().'
'.aantalDagen($key).' €'.number_format_drop_zero_decimals($regel[$indebuurt->posts[$i]->post_title], 2).'
'; if(get_field('skipassen_toelichting')){ echo ''.get_field('skipassen_toelichting').''; } echo '

jeugd

'; if( have_rows('prijzen_skipassen', $parentpage) ): echo ''; if( $indebuurt->have_posts() ){ while ( $indebuurt->have_posts() ){ $indebuurt->the_post(); if($post->geo_query_distance>0){ echo ''; } else{ echo ''; } } } echo ''; foreach($skipasprijzen['jeugd'] as $key => $regel){ $i = 0; echo ''; foreach($indebuurt->posts as $test){ if(isset($regel[$indebuurt->posts[$i]->post_title])){ $prijs = $regel[$indebuurt->posts[$i]->post_title]; echo ''; } else{ echo ''; } $i++; } echo ''; } echo '
Skipasprijs hoogseizoen'.get_the_title().' ('.round($post->geo_query_distance).'km)'.get_the_title().'
'.aantalDagen($key).' €'.number_format_drop_zero_decimals($regel[$indebuurt->posts[$i]->post_title], 2).'
'; endif; if(get_field('skipassen_toelichting')){ echo ''.get_field('skipassen_toelichting').''; } echo '

kinderen

'; if( have_rows('prijzen_skipassen', $parentpage) ): echo ''; if( $indebuurt->have_posts() ){ while ( $indebuurt->have_posts() ){ $indebuurt->the_post(); if($post->geo_query_distance>0){ echo ''; } else{ echo ''; } } } echo ''; foreach($skipasprijzen['kinderen'] as $key => $regel){ $i = 0; echo ''; foreach($indebuurt->posts as $test){ if(isset($regel[$indebuurt->posts[$i]->post_title])){ $prijs = $regel[$indebuurt->posts[$i]->post_title]; echo ''; } else{ echo ''; } $i++; } echo ''; } echo '
Skipasprijs hoogseizoen'.get_the_title().' ('.round($post->geo_query_distance).'km)'.get_the_title().'
'.aantalDagen($key).' €'.number_format_drop_zero_decimals($regel[$indebuurt->posts[$i]->post_title], 2).'
'; endif; if(get_field('skipassen_toelichting')){ echo ''.get_field('skipassen_toelichting').''; } echo '

webcams

'; if(isset($webcams['result']['webcams'][0])){ echo '
'; for ($i = 0; $i <= 3; $i++) { echo ''; if($i == 1){ echo '
'; } } echo '
'; } echo '

Meer webcams in '.get_the_title($parentpage).'

nieuws

'; $idObj = get_category_by_slug($post_slug); $id = $idObj->term_id; $category = get_category($id); // $category_slug=$category->slug; $categorys=array(); $parentid = $category->category_parent; //echo $parentid; $parent = get_category($parentid); // var_dump($parent); $args = array( 'posts_per_page' => '2', 'post_type' => 'post', 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'cat' => $id ); $query = new WP_Query($args); $posts = $query->posts; $i = 0; if( $posts ) { foreach( $posts as $post) { echo '
'; array_push($categorys,$post->ID); setup_postdata($post); $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'nieuws_image'); echo ' '; echo '
'; the_title(); echo '
'; the_excerpt(); echo '
'; $i++; } wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly } //echo $i; $aantal=2-$i; // wp query parent cat if($i < 2) { $args = array( 'posts_per_page' => $aantal, 'post_type' => 'post', 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'category__in' => $parentid, 'post__not_in' => $categorys ); $query = new WP_Query($args); $posts = $query->posts; if( $posts ) { //echo '
in loop 2'; if($i<2) { foreach( $posts as $post) { echo '
'; //echo 'tweede i: '.$i; setup_postdata($post); $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'nieuws_image'); echo '
'; the_title(); echo '
'; the_excerpt(); echo '
'; $i++; }wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly } } } echo '

Meer nieuws over '.get_the_title($parentpage).'

';