cat_ID; // define custom query parameters $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $custom_args = array( 'cat' => $firstCategory, 'posts_per_page' => 2, 'paged' => $paged, 'post__not_in' => array($currentID) // exclude current post ); $custom_query = new WP_Query( $custom_args ); // fix pagination $temp_query = $wp_query; $wp_query = NULL; $wp_query = $custom_query; ?> have_posts() ) : ?>