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);$idObj = get_category_by_slug($post_slug); $id = $idObj->term_id; $category = get_category($id); $parentid = $category->category_parent; $parent = get_category($parentid);$categorys=array();//ophalen van diepste (child) categorie $childargs = array( 'posts_per_page' => '12', 'post_type' => 'post', 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'category__in' => $id );array_push($categorys,$id); $parentsargs = array( 'posts_per_page' => '12', 'post_type' => 'post', 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'category__in' => $parentid, 'category__not_in' => $categorys );array_push($categorys,$parentid); //print_r($categorys); $allargs = array( 'posts_per_page' => '12', 'post_type' => 'post', 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'date', 'category__not_in' => $categorys );//$query = new WP_Query($allargs); //print_r($query->posts);echo '
'; echo '

Nieuws over skigebied '.get_the_title($parentpage).'

'.get_field('nieuws_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 '
'; $overgebleven = getPosts($childargs,0); $overgebleven = getPosts($parentsargs,$overgebleven); $overgebleven = getPosts($allargs,$overgebleven); echo '
';function getPosts($args,$counter){ $loop = new WP_Query($args); $counter = $counter;if($loop->have_posts()) : if($counter == 0){ echo '
'; } while($loop->have_posts()) : $loop->the_post(); if($counter == 3 || $counter == 9 ) { $class = ''; } else { $class = 'offset-md-1'; } echo '
'; the_post_thumbnail( 'nieuws_image' ); echo '

'.get_the_title().'

'; the_excerpt(); echo custom_field_excerpt(get_field('blok_1_tekst')).' Lees meer
';//advertentie-ruimte if($counter==5) { echo '
'; } if($counter==8) { echo '
'; return; } $counter++; endwhile; if($counter == 5){ echo ''; } /* if ( $loop->max_num_pages > 1 ) : previous_posts_link( 'Vorige pagina' ); next_posts_link( 'Volgende pagina', $loop->max_num_pages ); endif; */ endif; wp_reset_postdata(); return $counter; }