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); $land = get_the_terms( $post, 'land' ); $landurl = get_term_link($land[0]->term_id);$locations=array(); $webcamcount = 0; $webcamrowcount = 0; $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) )); echo'

webcams in '.get_the_title($parentpage).'

'; foreach($webcams['result']['webcams'] as $webcam){ if($webcamrowcount < 3){ if($webcamcount == 0){ echo '
'; } echo '

'.$webcam['title'].'

'; if($webcamcount == 2){ echo '
'; $webcamcount = -1; $webcamrowcount++; } $webcamcount++; } }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'].'
';echo '
'.get_the_title().'
'.round($post->geo_query_distance).'km
'; } } echo'

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

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

';?>