posts_per_page not returning expected result
-
Hi guys,
For the life of me I can’t see why posts_per_page is still only returning 5 posts even though I have set it to -1 to catch all posts within that category. There are over 60 of them!
Any help will be appreciated.
<?php $args = array( 'posts_per_page' => -1, 'offset'=> 0, 'category' => 6 ); $lastposts = get_posts( $args ); foreach ( $lastposts as $post ){ setup_postdata( $post ); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘posts_per_page not returning expected result’ is closed to new replies.