title: Wordpress : Pagination issue for page 5 and more for parent cat
body: <p>I've got a weird issue on one of my websites.</p>
  
  <p>I have a parent category. When I browse the posts from this parent category, I get a 404 from page 5 to the next ones. I call the URL www.site.ext/maincat/page/5 (or www.site.ext/?cat=XXX&amp;paged=5 without url rewriting enabled).</p>
  
  <p>When I browse subcats, I've got no issue. for example www.site.ext/maincat/subcat/page/5 works well. Even more, if there is no page 5, I've got a blank page (no posts) but not a 404.</p>
  
  <p>I've set 6 posts per page. But If I set 2 or 100, I've got the error on page 5 (and more) everytime. No matter the posts displayed.</p>
  
  <p>Page 4 and below are working well.</p>
  
  <p>I declare the number of posts displayed just with : <code>query_posts($query_string . '&amp;posts_per_page=6');</code></p>
  
  <p>I've already set up the number of max posts displayed and rss feed to 1.
  I'm using wp-pagenavi to display pagination but no matter if any plugins are activated or not, I've got this issue.</p>
  
  <p>It's the first time I encounter such an issue. You can get it live there : <a href="https://www.dlmenuiserie.fr/nos-actus/page/4/" rel="nofollow noreferrer">https://www.dlmenuiserie.fr/nos-actus/page/4/</a> and <a href="https://www.dlmenuiserie.fr/nos-actus/page/5/" rel="nofollow noreferrer">https://www.dlmenuiserie.fr/nos-actus/page/5/</a></p>
  
  <p>-- EDIT --</p>
  
  <p>I changed my old query from that : </p>
  
  <pre><code>query_posts($query_string . '&amp;posts_per_page=6');
  </code></pre>
  
  <p>to this : </p>
  
  <pre><code>$args = array( 'post_type' =&gt; 'post', 'posts_per_page' =&gt; 6, ); 
  $query = new WP_Query($args);
  </code></pre>
  
  <p>Now I have only 4 pages displayed. But I know there are other ones. So there is something with the query I think...</p>
  
  <p>This issue is still only on the parent cat.</p>
  
  <p>Do you have any ideas ?</p>