posts_per_page option limits the number of Gallery items

You need to post the query code of both the post query and the gallery query; no one can really make a guess otherwise.

You can try using <?php wp_reset_query(); ?> after the post query to force a reset.

See http://codex.wordpress.org/Function_Reference/wp_reset_query

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