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);$forecast = json_decode(get_field('weerapi_forecast_data'),true); $report = json_decode(get_field('weerapi_report_data'),true); $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'

Top

Nu
' .$forecast['forecast'][$array_time_value]['upper']['temp_c'].'℃
';echo '
Wind
'.$forecast['forecast'][$array_time_value]['upper']['windspd_kmh'].'km/u
'; echo '
Straks
' .$forecast['forecast'][$array_time_value+1]['upper']['temp_c'].'℃
'.$forecast['forecast'][$array_time_value+1]['upper']['windspd_kmh'].'km/u
Morgen
' .$forecast['forecast'][11]['upper']['temp_c'].'℃
'.$forecast['forecast'][11]['upper']['windspd_kmh'].'km/u
'.getday(2).'
' .$forecast['forecast'][19]['upper']['temp_c'].'℃
'.$forecast['forecast'][19]['upper']['windspd_kmh'].'km/u
'.getday(3).'
' .$forecast['forecast'][27]['upper']['temp_c'].'℃
'.$forecast['forecast'][27]['upper']['windspd_kmh'].'km/u
'.getday(4).'
' .$forecast['forecast'][35]['upper']['temp_c'].'℃
'.$forecast['forecast'][35]['upper']['windspd_kmh'].'km/u
'.getday(5).'
' .$forecast['forecast'][43]['upper']['temp_c'].'℃
'.$forecast['forecast'][43]['upper']['windspd_kmh'].'km/u

Midden

Nu
' .round(($forecast['forecast'][$array_time_value]['upper']['temp_c']+$forecast['forecast'][$array_time_value]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
';echo '
Wind
'.$forecast['forecast'][$array_time_value]['mid']['windspd_kmh'].'km/u
'; echo '
Straks
' .round(($forecast['forecast'][$array_time_value+1]['upper']['temp_c']+$forecast['forecast'][$array_time_value+1]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
'.$forecast['forecast'][$array_time_value+1]['mid']['windspd_kmh'].'km/u
Morgen
' .round(($forecast['forecast'][11]['upper']['temp_c']+$forecast['forecast'][11]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
'.$forecast['forecast'][11]['mid']['windspd_kmh'].'km/u
'.getday(2).'
' .round(($forecast['forecast'][19]['upper']['temp_c']+$forecast['forecast'][19]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
'.$forecast['forecast'][19]['mid']['windspd_kmh'].'km/u
'.getday(3).'
' .round(($forecast['forecast'][27]['upper']['temp_c']+$forecast['forecast'][27]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
'.$forecast['forecast'][27]['mid']['windspd_kmh'].'km/u
'.getday(4).'
' .round(($forecast['forecast'][35]['upper']['temp_c']+$forecast['forecast'][35]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
'.$forecast['forecast'][35]['mid']['windspd_kmh'].'km/u
'.getday(5).'
' .round(($forecast['forecast'][43]['upper']['temp_c']+$forecast['forecast'][43]['base']['temp_c'])/2, 0, PHP_ROUND_HALF_DOWN).'℃
'.$forecast['forecast'][43]['mid']['windspd_kmh'].'km/u

Dal

Nu
' .$forecast['forecast'][$array_time_value]['base']['temp_c'].'℃
';echo '
Wind
'.$forecast['forecast'][$array_time_value]['base']['windspd_kmh'].'km/u
'; echo '
Straks
' .$forecast['forecast'][$array_time_value+1]['base']['temp_c'].'℃
'.$forecast['forecast'][$array_time_value+1]['base']['windspd_kmh'].'km/u
Morgen
' .$forecast['forecast'][11]['base']['temp_c'].'℃
'.$forecast['forecast'][11]['base']['windspd_kmh'].'km/u
'.getday(2).'
' .$forecast['forecast'][19]['base']['temp_c'].'℃
'.$forecast['forecast'][19]['base']['windspd_kmh'].'km/u
'.getday(3).'
' .$forecast['forecast'][27]['base']['temp_c'].'℃
'.$forecast['forecast'][27]['base']['windspd_kmh'].'km/u
'.getday(4).'
' .$forecast['forecast'][35]['base']['temp_c'].'℃
'.$forecast['forecast'][35]['base']['windspd_kmh'].'km/u
'.getday(5).'
' .$forecast['forecast'][43]['base']['temp_c'].'℃
'.$forecast['forecast'][43]['base']['windspd_kmh'].'km/u

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

';