get_terms('category'); $post_cat = $post_cat[0]->ID; $context['related'] = Timber::get_posts(array( 'posts_per_page' => 2, 'post_type' => 'post', 'post__not_in' => array($context['post']->ID), 'cat' => $post_cat, )); } } Timber::render( $template, $context );