/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_post_type_archive('project')) { $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_page()) { $context['post'] = new TimberPost(); $template = [$context['post']->_wp_page_template . '.twig', 'page.twig']; } else if (is_search()) { wp_safe_redirect('/', 301); exit(); } else if (is_404()) { $template = ['errors/404.twig']; } Timber::render($template, $context); ?>