The post limit is controlled in the admin panel, at Settings > Reading
. There you can set the limit for how many posts should be shown in a query. However, the default post count for get_posts()
is 5.
If you would like to query unlimited posts (regardless of performance issues), you can either create your own instance of WP_Query()
or use the pre_get_posts
filter to do so.
Using WP_Query()
is pretty straight forward, and all you have to do is to pass -1
to the query. You can do the same with get_posts()
:
$args = array (
'posts_per_page' => -1,
// Rest of the arguments here
);
$query = new WP_Query($args);
Now you can use a simple while()
loop to output your content.