Looks like you might be missing the wp_reset_postdata()
in here. The WordPress codex shows you need to have a wp_reset_postdata()
after your while loop.
Here’s WordPress’ example (which even has the posts_per_page
defined):
<?php
// example args
$args = array( 'posts_per_page' => 3 );
// the query
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) : ?>
<!-- start of the loop -->
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php endwhile; ?><!-- end of the loop -->
<!-- put pagination functions here -->
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
http://codex.wordpress.org/Function_Reference/wp_reset_postdata