WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Simple custom post query for all posts, or many of them, not working (5 posts)

  1. Comparativa de Bancos
    Member
    Posted 1 year ago #

    I am doing this query

    $args = array(
    'posts_per_page' => '-1',
    'post_type' => 'cars',
    'post_status' => 'publish'
    );
    
    query_posts( $args );

    but it is not working

    I have around 800 posts in that custom type and the query_posts function is working just if posts_per_page < 519. I know is weird but if I do this

    $args = array(
    'posts_per_page' => '518', //or any lower number
    'post_type' => 'cars',
    'post_status' => 'publish'
    );
    
    query_posts( $args );

    it does work but not with

    $args = array(
    'posts_per_page' => '519', //or bigger
    'post_type' => 'cars',
    'post_status' => 'publish'
    );
    
    query_posts( $args );

    Any suggestion???

    Thanks

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You actually have a custom post type called "custom_post_type"?

  3. Comparativa de Bancos
    Member
    Posted 1 year ago #

    It was just an example, I changed it to cars.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Ah! I had to ask, though - just in case.. ;-)

    My best guess is that you're hitting some kind of server limitation. Some hosts will limit POST requests, for example. Have you asked your hosts about this? Are there any clues in the site's error logs?

  5. Comparativa de Bancos
    Member
    Posted 1 year ago #

    Increasing the limit didnt help but I found a workaround to make it work.
    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic