/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_page()) { $context['post'] = new TimberPost(); $template = [$context['post']->_wp_page_template . '.twig', 'page.twig']; if (post_password_required($context['post']->ID)) { $template = 'page-password.twig'; } } else if (is_post_type_archive('project')) { $post_type = get_queried_object(); $page = get_page_by_path($post_type->rewrite['slug']); $context['page'] = new TimberPost($page->ID); $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')) { $post_type = get_queried_object(); $page = get_page_by_path($post_type->rewrite['slug']); $context['page'] = new TimberPost($page->ID); $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('staff')) { $post_type = get_queried_object(); $page = get_page_by_path($post_type->rewrite['slug']); $context['page'] = new TimberPost($page->ID); $context['posts'] = Timber::get_posts(); $template = ['staff-index.twig']; } else if (is_search()) { $posts = Timber::get_posts(); $template = ['search.twig']; } else if (is_404()) { $template = ['errors/404.twig']; } Timber::render($template, $context); ?>