post_type == CPT_BACKPACK ): $context['upcoming_dbp'] = Timber::get_posts([ 'post_type' => CPT_BACKPACK, 'posts_per_page' => 2, 'meta_key' => 'event_date', 'orderby' => 'meta_value', 'order' => 'ASC', 'post_status' => 'publish', 'meta_query' => [ [ 'key' => 'event_date', 'compare' => '>=', 'value' => wp_date( 'U' ), 'type' => 'NUMERIC', ], ], 'post__not_in' => [ $post->ID ] ]); endif; if ( $post->post_type == 'post' ): $template = 'singles/news.twig'; $context['news'] = Timber::get_posts([ 'post_type' => 'post', 'posts_per_page' => 3, 'orderby' => 'title', 'order' => 'DESC', 'post_status' => 'publish', 'post__not_in' => [ $post->ID ], 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => array('featured-post', 'news','announcements') ) ) ]); endif; if( in_category( 'announcements' ) ): $template = 'singles/announcement.twig'; endif; Timber::render( [ 'singles/' . str_replace( '_', '-', $post->post_type ) . '.twig', $template ], $context );