Category pagination not working

You should take a closer look at the [http://codex.wordpress.org/Template_Hierarchy Template Hierarchy]. From what I understood in your code is that you’re trying to list posts in the category where ID = 5. You can easily map that to the category-slug.php or category-id.php template files, so you won’t have to do any extra get_posts.

The problem with pagination is that wp_pagenavi is looking for your $wp_query global and doing pagination for the original query (which you don’t filter.) Or maybe the only reason is that your WP-PageNavi plugin is not installed or disabled 😉

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