In function.php
add_action('pre_get_posts','show_all_people');
function show_all_people( $query ) {
if ( $query->is_main_query() && is_post_type_archive('people') ) {
$query->set('posts_per_page', -1);
}
}
See Codex docs for pre_get_posts
hook
Related Posts:
- Pagination problems with multiple custom post type archive pages
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Pagination links for custom post type shows correct number of links, but links result in Page not found
- Get Non-Paginated Index of Post in Paginated Query
- Pagination not working only on Archive-Name.php using new WP_Query
- Pagination throws 404 error on custom taxonomy archive pages
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Pre get posts for single post
- Archive page…limiting posts per page
- Pagination not working with custom category template
- Custom Post Type pagination – normal solutions aren’t helping
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Posts in Multiple Columns and Rows with one single loop
- Paginate Custom Post Type Page
- Creating a simple pagination for custom post type templates
- Pagination not working
- Pagination Custom post type
- Pagination Issue: Custom Post Type In Index
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Custom post type and taxonomy permalinks – Structure
- Pagination problem
- Custom post type archive not regarding ‘posts_per_page’ => -1
- Unable to get paginate_links working with a custom query [duplicate]
- Setting posts per page in query_posts
- Custom post type, permalinks & pagination, going wrong
- Repeating posts when paginating random posts
- Pagination for custom php code
- Pagination for Custom Taxonomy Page [duplicate]
- Pagination on with query_posts in custom post type template
- Paging doesn’t work?
- Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
- Help with Elementor Pagination CPT archive 404 problem
- Custom taxonomy rewrite give pagination 404
- Next and Previous Posts of Same Parent
- How to handle paged param in post and custom-post-type?
- Next Post links not working in custom post type shortcode
- Custom Post Types strange pagination problem
- Custom post type pagination – always return first page
- Custom Post Archive is not working
- Pagination custom post type not working with rewrite slug
- Pagination Not Working for Custom Taxonomy with Custom Query – 404 Error
- Custom WP_Query always respond with 200 status even when no entry
- Pagination 404 on Index with custom query
- Pagination doesnt work in custom post type
- Break up posts per page in two sections
- Pagination on search results page
- 404 Page Not Found on /Page/2/ on Tag Page
- CPT with its own category and tag url
- Custom Post Type Archive template not being called
- Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis
- Custom Post Type Archive Pagination
- Taxonomy rewrite pagination 404
- Custom Post Type Pagination on Single.php?
- Custom post type pagination error
- Pagenavi Plugin and Custom Post Type – Multipage results
- Is possible register two archive pages for single custom post type?
- Add pagination to custom single post template
- get_query_var(‘paged’) return 0 in custom category page
- Custom post type paging return home page
- Pagination on custom post type without plugin
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Pagination for custom query returns 404
- Custom post type pagination problem – page 1 and 2 show same content
- Custom Post Type Pagination – not displaying posts
- get first limited words from a custom post in the archive page
- next_posts_link() always generates second page link on custom post type
- Post navigation doesn’t show (in custom template, custom post type, custom query)
- 2 custom posts types, in their own columns, one pagination for both
- Pagination functions won’t work
- pagination for a custom query
- Show index and not the archive for “Dog Custom Post” with default slug
- Custom post type archive page not showing on archive-posttype.php
- Making a archive gallery page for a custom post type which already has an archive page
- Paging not working for hierarchical custom post type
- Custom taxonomy in custom post type archive with pagination
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- why custom post archive gives always no more than 10 posts despite of paging settings?
- Pagination on custom post types
- Archive templates based on taxonomies
- Organizing Custom Post Type Archive Template
- Pagination in custom loop for custom post type throwing 404 error
- Pagination for a Custom Taxonomy
- Pagination with Custom Post Type
- paging is not working properly on news archives page [duplicate]
- Pagination URL order
- WordPress Load more posts by ajax not working
- Pagination for event query
- Two different archive pages showing the same content
- Problems with pagination for a custom post type
- WordPress custom post type post and category links 404
- Pagination not working for archive
- Archive page – problem with pagination
- Pagination not working in custom post type
- Pagination not working
- Pagination on category pages using wp_pagenavi causes 404 errors
- CPT Archive Pagination – Page not found
- Custom post type pagination conflict result in 404