Change CPT Archive Post Count Per Page?

What is the best way to go about setting a specified post count on a CPT Archive?

  1. I know that all Archives currently inherit the blog count in Settings > Reading > Blog Posts Number
  2. However, I’d love to be able to have (for example) 9 posts per page on the blog (easy peasy) but then 20 posts per page on this one custom post type.

Am I missing something simple? Or is this a bonkers request?

As always, you guys are appreciated.

Thanks :slight_smile:

Hi @DoncoMarketing,

There might be a plugin out there for this, but it comes down to tapping into the WordPress pre_get_posts hook. Here’s the WP documentation: https://developer.wordpress.org/reference/hooks/pre_get_posts/ They have some code examples there. The idea is you want to check if the current post type is your custom one, then modify the posts_per_page variable to 20.