How to remove pagination from category list of excerpts

I want to show a category list of excerpts in one long page instead of having pagination. I know I can do this with a WP plugin but I’m trying to now avoid too many plugins, I’m sure there must be some very simple code to do this. Can anyone help please? Thanks

(alternatively instead of one long page, infinite scroll would be fine but I think that may be a lot more complex)

How are you displaying the excerpts, i.e. in an actual page or on an archive or category page?

On a category. e.g:

'30s - '40s - JAZZY PRODUCTION MUSIC (using Classic SEO with Strip category base so /category/ is not showing in URL)

NB: I’m currently doing it with a plugin but I’m on a crusade to get rid of as many plugins as possible.

This should do it:

function cp_disable_pagination( $query ) {
  if ( is_category( 'newsletter' ) ) {
    $query->set( 'posts_per_page', '-1' );
  }
}
add_action( 'pre_get_posts', 'cp_disable_pagination' );

If you want to do that for all categories, just use if ( is_category() ) {

Perfect thanks, one more …do you know how to make the excerpts display in alphabetical order (of title) rather than date order?

After the first $query->set line, add this:

$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );

Then finish as before