How to avoid filling up an array each time I run a WP_query?
The obvious first step would be to use get_col instead of get_result. You will get an array returned straightaway so you could skip your foreach and go straight to: $args = array( ‘author__in’ => $following_users_ids, ‘posts_per_page’ => 12, ‘paged’ => $paged, ); Behind the scenes, get_col does much what you are doing but you are … Read more