How to make WPQuery custom post type work in Twig / Timber

I think is as simple as using Timber’s Timber::get_posts() instead of the WP_Query class: $context[‘testimonials’] = Timber::get_posts( [‘post_type’ => ‘what_our_clients_say’, ‘posts_per_page’ => 2] ); Timber::render(‘whatever.twig, $context); … from there you can loop through the testimonials and access ACF values via meta: {% for post in testimonials %} <h1>{{ post.attribution }} says:</h1> {# more here #} … Read more

3 posts from each existing category on one page

I found a problem. I had to change this: $args = array( ‘cat’ => $category->name, ‘posts_per_page’ => 3,); for this: $args = array( ‘category_name’ => $category->name, ‘posts_per_page’ => 3,); In first code I was passing category name which is string to argument expecting ID of category. Here is Codex reference where I found solution: category_name … Read more