title: Trouble with pagination wordpress category page
body: <p>I am in trouble with the category page in wordpress, I want to display the pagination and I used a method that works in other templates that I developed in the past.</p>
  
  <p>I get the Category ID</p>
  
  <pre><code>$category = get_category( get_query_var( 'cat' ) );
  $cat_id = $category-&gt;cat_ID;
  </code></pre>
  
  <p>Declare the pagination      </p>
  
  <pre><code>    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
  
      $wpquery = new WP_Query(array(
          'order' =&gt; 'DESC',
          'cat' =&gt; $cat_id,
          'posts_per_page' =&gt; 4,
          'paged'=&gt;$page
      ));
  </code></pre>
  
  <p>And after my Loop I show the pagination</p>
  
  <pre><code>    global $wpquery;
      if( $wpquery-&gt;max_num_pages &gt;1){
        $big = 999999999; // need an unlikely integer
  
        echo paginate_links( array(
       'base' =&gt; str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
       'format' =&gt; '?paged=%#%',
       'current' =&gt; max( 1, get_query_var('paged') ),
       'total' =&gt; $wpquery-&gt;max_num_pages
         ) );
     }
  </code></pre>
  
  <p>If you try to go here </p>
  
  <pre><code>http://192.185.20.70/~t1t/tobeus.it/category/press/
  </code></pre>
  
  <p>you can see that the first &amp; second page works, the third shows a 404...</p>
  
  <p>in the other categories like "events" </p>
  
  <pre><code> http://192.185.20.70/~t1t/tobeus.it/category/events/
  </code></pre>
  
  <p>only the first page works...</p>
  
  <p>I can't solve this strange problem!</p>