'nieuws', 'orderby' => 'date', 'post_status' => 'publish', 'posts_per_page' => 9, ); $context['news'] = Timber::get_posts($posts_query); $event_query = array( 'post_type' => 'evenementen', 'orderby' => 'date', 'post_status' => 'publish', 'posts_per_page' => 6, ); $context['evenementen'] = Timber::get_posts($event_query); $blog_query = array( 'orderby' => 'date', 'post_status' => 'publish', 'posts_per_page' => 3, ); $context['blog'] = Timber::get_posts($blog_query); $template = ['home.twig'];}else if (is_page()){ $context['post'] = new TimberPost(); $template = ['page.twig'];}else if (is_home()){ $context['post'] = new TimberPost(); $posts_query = array( 'post_type' => 'post', 'orderby' => 'date', 'post_status' => 'publish' ); $context['posts'] = Timber::get_posts($posts_query); $template = ['blog.twig'];}else if (is_singular('webcams')){ $context['post'] = new TimberPost(); $context['news'] = Timber::get_posts($posts_query); $template = ['single-webcams.twig'];}else if (is_singular('nieuws')){ $context['post'] = new TimberPost(); $posts_query = array( 'post_type' => 'nieuws', 'orderby' => 'date', 'post_status' => 'publish', 'posts_per_page' => 9, ); $context['news'] = Timber::get_posts($posts_query); $template = ['single-nieuws.twig'];}else if (is_single()){ $context['post'] = new TimberPost(); $template = ['single.twig'];}else if (is_post_type_archive('webcams')){ $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts( array( 'post_type' => 'webcams', 'posts_per_page' => -1, 'orderby' => 'asc' ) ); $context['title'] = post_type_archive_title('', false); $template = ['archive-webcams.twig'];}else if (is_post_type_archive('nieuws')){ if (!isset($paged) || !$paged){ $paged = 1; } $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts( array( 'post_type' => 'nieuws', 'posts_per_page' => 12, 'orderby' => 'asc', 'paged' => $paged ) ); $context['title'] = post_type_archive_title('', false); $context['pagination'] = Timber::get_pagination(); $template = ['archive-nieuws.twig'];}else if (is_post_type_archive('evenementen')){ $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts(); $context['pagination'] = Timber::get_pagination(4); $context['title'] = post_type_archive_title('', false); $template = ['archive-evenementen.twig'];}else if (is_post_type_archive()){ $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts(); $context['title'] = post_type_archive_title('', false); $template = ['archive.twig'];}else if (is_category()){ $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts(); $context['title'] = single_cat_title('', false); $template = ['category.twig'];}else if (is_tag()){ $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts(); $context['title'] = single_cat_title('', false); $template = ['tag.twig'];}else if (is_search()){ $context['post'] = new TimberPost(); $context['posts'] = Timber::get_posts(); $context['searchterm'] = get_search_query(); $template = ['search.twig'];}else if (is_author()){ $context['author'] = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author')); $posts_query = array( 'post_type' => 'nieuws', 'orderby' => 'date', 'post_status' => 'publish', 'author' => $context['author']->ID, ); $context['news'] = Timber::get_posts($posts_query); $template = ['author.twig'];}else if (is_404()){ $template = ['errors/404.twig'];}Timber::render($template, $context);?>