WordPress: multiple loops
The only thing that changes between the first and second half is the query parameters.

&lt;?php

foreach (array('news' =&gt; 3, 'reviews' =&gt; 4) as $category =&gt; $posts_per_page) {
    $wp_query = new WP_Query(
        "category_name=$category&amp;posts_per_page=$posts_per_page"
    );
    while ( $wp_query-&gt;have_posts() ) {
        # etc.
    }
}

?&gt;