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); $land = get_the_terms( $post, 'land' ); $landurl = get_term_link($land[0]->term_id); $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' => 6, 'post_parent' => 0, 'post__not_in' => array($parentpage) )); //print_r($indebuurt); $webcams = json_decode(get_field('webcamapi_data', $parentpage),true);echo'

De omgeving van '.get_the_title($parentpage).'

'.get_field('in_de_buurt_tekst',$parentpage).'
'.get_field('skikaart')['alt'].'
'; echo '

skiresorts in de buurt

'; if( $indebuurt->have_posts() ){ while ( $indebuurt->have_posts() ) { $indebuurt->the_post(); echo '
'; $afbeeldingen = get_field('afbeeldingen')[0]; //print_r($afbeelding); //print_r( $afbeeldingen );echo '
'.$afbeeldingen['afbeelding']['alt'].'
';//print_r($post->geo_query_distance); echo '
'.get_the_title().' ('.round($post->geo_query_distance).'km)
'.custom_field_excerpt(apply_filters('the_content', get_field('omgeving_tekst')),24).' Lees meer
'; } } echo'

Alle skiresorts in '.$land[0]->name.'

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).'

';