WordPress WP-PageNavi Not working on Home Page

I have came across this problem lately in one of the wordpress theme SevenMag.
I searched for a long hours of time and was not able to beat it. The wp-pagenavi function was inside the theme and I was not using as a plugin.

I tried installing the plugin instead hoping that it will work and tried to make the default wp-pagenavi option to disable.
But I couldn’t get luck on that either. My problem was the pagination error on home page only that I was clicking the Page 2, 3, 4, … it still returned me Page 1.
So I got through this solution of code.

I replaced all the

query_posts('cat=10');

or if you have any other form like

query_posts( array( 'cat' => 10 ) );

Just change it to

query_posts( array( 'cat' => 10, 'paged' => get_query_var('paged') ) );

If that doesn’t work try

query_posts( array( 'cat' => 10, 'paged' => get_query_var('page') ) );

The bottom line is just replace

‘paged’ Key Value to get_query_var(‘paged’) or get_query_var(‘page’) which ever suits your case in the PHP files where ever your theme have included it.
In my case it was 3 files page.php, pagination-blank.php, pagination-slideshow.php

And you might get a working pagination with WP-PageNavi.

Loading