/wp-admin/plugins.php'; return; } if (!class_exists('acf') ) { echo 'ACF not activated. Make sure you activate the plugin in /wp-admin/plugins.php'; return; } $context = Timber::get_context(); if (is_front_page()) { $context['featured'] = get_field('featured', 'option'); $template = ['home.twig']; } else if (is_post_type_archive('project')) { $context['filters'] = Timber::get_terms('type', ['hide_empty' => true]); $context['posts'] = Timber::get_posts(); $template = ['project-index.twig']; } else if (is_singular('project')) { $context['post'] = Timber::query_post(); $template = ['project-single.twig']; } else if (is_post_type_archive('news')) { $context['posts'] = Timber::get_posts(); $template = ['news-index.twig']; } else if (is_singular('news')) { $context['post'] = Timber::query_post(); $template = ['news-single.twig']; } else if (is_post_type_archive('team')) { $posts = Timber::get_posts(); $template = ['team-index.twig']; } else if (is_singular('team')) { $post = Timber::query_post(); if (!isset($post->detail) || $post->detail == false) { wp_safe_redirect('/bureau/', 301); exit(); } $context['post'] = $post; $template = ['team-single.twig']; } else if (is_page()) { $context['post'] = new TimberPost(); $template = ['page.twig']; } else if (is_search()) { wp_safe_redirect('/', 301); exit(); } else if (is_404()) { $template = ['errors/404.twig']; } Timber::render($template, $context); ?>