Recent posts headlines. How to optimize the loop
Instead of looping through each category and getting the posts for each, you can do it all in one query like this: $categories = array(‘8’, 17, 23, 423); $args = array( ‘category__in’ => $categories, ‘numberposts’ => 20 ); $recent_posts = get_posts($args); Cheers.