• I’m just building a site and I want to show the titles of all post of a category without paging. But if there more than 250 posts you see nothing only white.

    Here the code I used:
    <?php $posts = query_posts(‘cat=’.$cat.’&orderby=title&order=asc&posts_per_page=-1′); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <b><?php the_title(); ?></b><br>
    ….
    If I set posts_per_page=250 all works fine. Is there any limit in the wordpress code or is this a server problem?

    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • i think thats being caused by something else. See here:

    https://www.village-idiot.org/my-title1.php

    Thats 678 posts.

    I’m hoping youre closing that correctly, like so:

    <?php get_header(); ?>
    
    	<?php $posts = query_posts('cat='.$cat.'&orderby=title&order=asc&posts_per_page=-1'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <b><?php the_title(); ?></b><br>
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    Thread Starter luigibelani

    (@luigibelani)

    Yes, I closed it correctly. It works with posts_per_page=250.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘post per page = -1 show nothing’ is closed to new replies.