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 '
'; */ echo'

skigebied '.get_the_title($parentpage).'

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

bereikbaarheid vliegtuig

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

bereikbaarheid auto

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

beste periode

jan
feb
maa
apr
mei
jun
jul
aug
sep
okt
nov
dec

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

'; ?>