I am using WP-PageNavi pagination and because of certain reasons I have "Blog pages show at most" set to 100 and I can't reduce it.
I have a total of 30 posts in a category. I want to display 10 posts on each page but it doesn't display pagination; it displays only if a category has more then 100 posts. Code is below:
$cat_id = get_query_var( 'cat' );
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$found_posts = array(
'posts_per_page' => 10,
'cat' => $cat_id,
'meta_key' => "custom_key",
'meta_value' => '',
'meta_compare' => '!=',
'ignore_sticky_posts' => 1,
'orderby' => 'meta_value_num', // or 'meta_value_num'
'order' => "DESC",
'paged' => $paged
);
$loop = new WP_Query( $found_posts );
while( $loop->have_posts() ): $loop->the_post();
global $post;
// Loop Here
endwhile;
wp_reset_query();
if ( function_exists( 'wp_pagenavi' ) ) {
wp_pagenavi();
}