• Resolved snails07

    (@snails07)


    I’m having trouble displaying any more than around 70 posts on one page for some reason and it seems to have only happened after updating to the latest version of WordPress. I need to display every single post (over 1500 of them) on my sitemap page and also another page.
    I am using the code below but it isn’t working

    wp_reset_query();
    $result = new WP_Query('posts_per_page=-1');

    I’ve also tried using the below code as well as 'showposts=1500'

    $result = new WP_Query('posts_per_page=1500’);

    But any number over 70 and I just get a blank white page.
    Anybody know why this may be? It was all working perfectly until I did some updates to plugins and to WordPress.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Perhaps it’s a memory or timeout issue. Have you checked your server’s error logs?

    Thread Starter snails07

    (@snails07)

    Thank you esmi, that was the problem.
    I’d changed the memory limit for some reason when I was messing around with something else. You’re a lifesaver!

    I’m having a problem similar to this (actually, seemingly identical) except that I am only trying to display 200 posts. More posts exist, but WordPress seems to fail to get any more than about 150. This is after I increased PHP’s memory limit to 256mb. Previously, it could only get about 60 pages using 32mb of memory. This seems like a lot of memory to get relatively few posts. Could there be another factor that is limiting the WP_Query results?

    Please post a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can't display all posts on a page’ is closed to new replies.