You just have to check/count how many posts you alreay handled.
$num_post = 1;
while ( have_posts() && ($num_post++ < 3) ) : ...
You just have to check/count how many posts you alreay handled.
$num_post = 1;
while ( have_posts() && ($num_post++ < 3) ) : ...