How to limit displayed posts on wordpress

You just have to check/count how many posts you alreay handled.

$num_post = 1;
while ( have_posts() && ($num_post++ < 3) ) : ...

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)