How to show more posts on an archive page?

You can use pre_get_posts action to achieve that:

add_action( 'pre_get_posts', function ($query) {
    if ( ! is_admin() && is_archive() && $query->is_main_query() ) {
        $query->set( 'posts_per_page', 100 );
    }
});

In the code above I use is_archive(), but you can use other conditional tags in there…

Leave a Comment