Code: 
 <?php $wp_query = new WP_Query( 'category_name=&posts_per_page='.get_option('posts_per_page'));
                 while ( $wp_query->have_posts() ) :  $wp_query->the_post();
                 
                 foreach((get_the_category()) as $category) {
                    $catname = $category->parent;
                    $cat_name = $category->name;
                    //$cat_parent= get_the_category_by_id( $catname);
                      $cat_id = $category->cat_ID;
                    if ($catname!=0)break;
                }
                
                //echo $catname . ' - ' . $cat_name;
                if(empty($catname)) $catname=$cat_id;
                 ?>
That is the original code, I replaced (1)
Code: 
category_name=&posts_per_page='.get_option('posts_per_page')
with (2)
Code: 
cat=-7&paged=' . $paged
Now Wp-pagenavi works, but what are the consequences of that? What does (1) do, vs (2) ?

Thanks in advance.
LuDo8 Reviewed by LuDo8 on . Difference between these two lines of code for Wordpress <?php $wp_query = new WP_Query( 'category_name=&posts_per_page='.get_option('posts_per_page')); while ( $wp_query->have_posts() ) : $wp_query->the_post(); foreach((get_the_category()) as $category) { $catname = $category->parent; $cat_name = $category->name; //$cat_parent= get_the_category_by_id( $catname); $cat_id = $category->cat_ID; Rating: 5