Resort informatie Weersverwachting Webcams Skipasprijzen Skigebied Nieuws Omgeving
post_content; $post_slug=$post->post_name; $resort_id = get_field('resort_id'); $lat = get_field('lat'); $lng = get_field('lng'); /* $current_timtestamp = time(); $weerapi_timestamp = get_field('weerapi_timestamp'); //$googleapi_timestamp = get_field('googleapi_timestamp'); $webcamapi_timestamp = get_field('webcamapi_timestamp'); if($current_timtestamp-$webcamapi_timestamp > 0){ //print_r(getWebcamdata($lat,$lng,15)); update_field('webcamapi_data',json_encode(getWebcamdata($lat,$lng,15),JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); update_field('webcamapi_timestamp',time()); } */ /* if($current_timtestamp-$weerapi_timestamp > 0){ update_field('weerapi_forecast_data',json_encode(getApidata('resortforecast',$resort_id))); update_field('weerapi_report_data',json_encode(getApidata('snowreport',$resort_id))); if(isset(json_decode(get_field('weerapi_report_data'),true)['uppersnow_cm'])){ update_field('sneeuwhoogte',json_decode(get_field('weerapi_report_data'),true)['uppersnow_cm']); } else{ update_field('sneeuwhoogte','0'); } update_field('weerapi_timestamp',time()); } */ //uitgeschakeld aangezien places API data te duur is in dit stadium /* if($current_timtestamp-$googleapi_timestamp > 2419200){ update_field('googleapi_restaurant_count',getPlacescount($lat,$lng,3000,'restaurant')); update_field('googleapi_cafe_count',getPlacescount($lat,$lng,3000,'cafe')); update_field('googleapi_store_count',getPlacescount($lat,$lng,3000,'store')); update_field('googleapi_bank_count',getPlacescount($lat,$lng,3000,'bank')); update_field('googleapi_night_club_count',getPlacescount($lat,$lng,3000,'night_club')); update_field('googleapi_spa_count',getPlacescount($lat,$lng,3000,'spa')); update_field('googleapi_parking_count',getPlacescount($lat,$lng,3000,'parking')); update_field('googleapi_hospital_distance',getPlacesdistance($lat,$lng,50000,'hospital')); update_field('googleapi_doctor_distance',getPlacesdistance($lat,$lng,50000,'doctor')); update_field('googleapi_timestamp',time()); } */ $forecast = json_decode(get_field('weerapi_forecast_data'),true); $report = json_decode(get_field('weerapi_report_data'),true); $webcams = json_decode(get_field('webcamapi_data'),true); //print_r(get_field('webcamapi_data')); echo '
'; echo '

'.get_the_title().'

'; if( have_rows('afbeeldingen') ): // loop through the rows of data while ( have_rows('afbeeldingen') ) : the_row(); $afbeelding = get_sub_field('afbeelding'); // display a sub field value echo '
'.$afbeelding['alt'].'
'; endwhile; endif; echo '

'.get_the_title().'

Nu
' .$forecast['forecast'][$array_time_value]['upper']['temp_c'].'℃
'; if(isset($report['uppersnow_cm'])&&isset($report['lowersnow_cm'])){ echo '
Sneeuw hoogte
'.$report['uppersnow_cm'].'cm
'; } if(isset($report['lastsnow'])){ echo '
Laatste sneeuwval
'.laatsteSneeuwval($report['lastsnow']).'
'; } if(isset($report['pctopen'])){ echo '
Skiliften open
'.$report['pctopen'].'%
'; } 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]['base']['temp_c'].'℃
Morgen
' .$forecast['forecast'][11]['upper']['temp_c'].'℃
' .$forecast['forecast'][11]['base']['temp_c'].'℃
'.getday(2).'
' .$forecast['forecast'][19]['upper']['temp_c'].'℃
' .$forecast['forecast'][19]['base']['temp_c'].'℃
'.getday(3).'
' .$forecast['forecast'][27]['upper']['temp_c'].'℃
' .$forecast['forecast'][27]['base']['temp_c'].'℃
'.getday(4).'
' .$forecast['forecast'][35]['upper']['temp_c'].'℃
' .$forecast['forecast'][35]['base']['temp_c'].'℃
'.getday(5).'
' .$forecast['forecast'][43]['upper']['temp_c'].'℃
' .$forecast['forecast'][43]['base']['temp_c'].'℃
'; if( have_rows('afbeeldingen') ): // loop through the rows of data while ( have_rows('afbeeldingen') ) : the_row(); $afbeelding = get_sub_field('afbeelding'); // display a sub field value echo '
'.$afbeelding['alt'].'
'; endwhile; endif; 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().'

'; echo '

'.get_the_title().'

'; echo ' '.get_field('blok_1_tekst').'

Meer over '.get_the_title().'

in de buurt

'.custom_field_excerpt(apply_filters('the_content', get_field('in_de_buurt_tekst')),55).'

De omgeving van '.get_the_title().'

skigebied

'.custom_field_excerpt(apply_filters('the_content', get_field('blok_2_tekst')),55).'

Meer over skigebied '.get_the_title().'

skipassen

'; if( have_rows('prijzen_skipassen') ): echo ''; while ( have_rows('prijzen_skipassen') ) : 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 '

Skipasprijzen in de buurt

bereikbaarheid vliegtuig

'.custom_field_excerpt(apply_filters('the_content', get_field('blok_3_tekst')),40).'

Meer over bereikbaarheid '.get_the_title().'

bereikbaarheid auto

'.custom_field_excerpt(apply_filters('the_content', get_field('blok_4_tekst')),40).'

Meer over bereikbaarheid '.get_the_title().'

'; if(get_field('skikaart')){ echo'
'.get_field('skikaart')['alt'].'
'; } else{ echo '
'; } echo'

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' => '3', '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=3-$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().'

landen

'; echo '
'; $landencount = 0; $landen = get_field('landen', 21); //print_r($landen); foreach ($landen as $post) { $term = get_term( $post, 'land' ); $image = get_field('vlag', 'land_' . $post); echo ''; $landencount++; if($landencount % 2 == 0 && $landencount<8){ echo '
'; } } echo '

Alle landen

';for ($i = 0; $i <= 3; $i++) { echo ''; }echo '';?>