• Hello

    I created custom loop, where I use post per page setting.

    After growing my database I realized that my page doesnt show list of post.

    I realized that maximum of post per pages is 255. If i set bigger number, loop doesnt run. I use pagination on my table script a and wanted to show them all because of sorting.

    link:
    page with bug

    'posts_per_page' => 255

    Do you have any advices or ideas, what to do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Off the top of my head I’d guess that you are hitting a MySQL limit, or a PHP request timeout. Does the query return successfully and then the loop fails, or does the query not return at all? var_dump() your custom loop query results.

    you could always remove the posts_per_page parameter on that particular loop.

    The link you mentioned is pulling in 300 posts!

    However the way you are doing pagination is not correct. You are importing all your posts with a single query. With this method you will certainly end in trouble as database grows.

    The right way is to query say 50 posts and display them, afterwards for page#2 use ‘offset’ parameter to get next 50 posts and so on. Using this technique you will not face issue even with million posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘maximum post per page setting, bug’ is closed to new replies.