ID ); wp_redirect( $redirect_url ); exit; } if ( is_page() && get_field( 'redirect', $context['post']->ID ) ) { $children = get_pages("child_of=".$context['post']->ID."&sort_column=menu_order"); $redirect_url = get_permalink( $children[0]->ID ); wp_redirect( $redirect_url ); exit; } // Templates if ( is_front_page() ) { $template = 'page-home.twig'; $context['page'] = 'home'; } elseif ( is_singular( 'post' ) ) { $template = 'post.twig'; $context['page'] = 'post'; } elseif ( is_page() ) { $template = 'page.twig'; $context['page'] = 'page'; } elseif ( is_404() ) { $template = '404.twig'; $context['page'] = '404'; } Timber::render( $template, $context );