'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => [ [ 'key' => 'post_author', 'value' => $author_id, 'compare' => '=' ] ] ]); if ($all_posts instanceof \Timber\PostQuery || $all_posts instanceof \Timber\PostCollection) { $all_posts = $all_posts->get_posts(); } $remaining_posts = array_slice($all_posts, 9); $context = Timber::context(); $context['posts'] = $remaining_posts; Timber::render('blog_author/author-posts-list.twig', $context); wp_die(); } add_action('wp_ajax_get_author_posts', 'get_author_posts'); add_action('wp_ajax_nopriv_get_author_posts', 'get_author_posts');