WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Custom query only displays 4 posts – rest is 404

[Resolved] Custom query only displays 4 posts – rest is 404

  • Hi all. I have been struggling with this custom query all day, but haven’t figured it out yet:

    At the moment I have 11 posts in the database, and I’m using this query to display 2 posts per page:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
    <?php query_posts('posts_per_page=2&cat=1&paged=' . $paged); ?>

    For some reason, only the first two pages (containg the four latest posts) is working – page 3 to 6 gives a 404 error. I have searched the forums and noticed that a lot of other people have had the same problems. I have tried almost every suggestion that has been posted, but nothing works for me. The weird thing is that I to begin with copy/pasted a query that’s working perfectly on another site I made. But I simply can’t get it to work on this site. Could it be a PHP or Apache issue? I am hosting the site in question on my own server, but may have misconfigured something…

    Try it out at http://89.150.187.166/stilstand.dk/htdocs/nyheder – but please ignore the weird colors etc 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Bump! Anyone?

    Okay, this doesn’t make any sense at all. In the Reading Settings, I changed “Blog pages show at most” to 1 post instead of the default 10, and it seems to work now. I guess this is resolved then…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Custom query only displays 4 posts – rest is 404’ is closed to new replies.
Skip to toolbar