Modifying WP_Query output everywhere is repetitive. the_posts filter catches all query results in one place. Add to functions.php: add_filter(‘the_posts’, function($posts, $query) { // Don’t modify admin queries if (is_admin()) return $posts; // Example: Add reading time to all posts foreach ($posts as $post) { $word_count = str_word_count(strip_tags($post->post_content)); $reading_time = ceil($word_count / 200); $post->reading_time = $reading_time […]