Martin’s fix works, but a better solution is to use the pre_get_posts function.
Example:
function custom_type_archive_display($query) {
if (is_post_type_archive('custom_type')) {
$query->set('posts_per_page',1);
return;
}
}
add_action('pre_get_posts', 'custom_type_archive_display');
Related Posts:
- pagination not working for category.php (custom post types in categories)
- Custom WP_Query always respond with 200 status even when no entry
- Custom post type blog pagination conflict
- send user to first page of results when reposting to page?
- Custom post type pagination 404 fix?
- Pagination throws 404 error on custom taxonomy archive pages
- Number of pages – multiple (custom) post types
- Display Custom Post Type Fields
- Custom permalink with pagination
- Related posts by author pagination not working on the production site
- Retrieving 3 latest post from each of 5 different custom post types
- Secondary loop pagination on custom post type single post gets redirected to first page
- Pagination Doesn’t Work
- how to group custom post type posts by custom taxonomy terms
- Numeric pagination custom post type
- Pagination throws 404
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- custom post type paging not working past page 3
- posts_nav_link on single post template
- Custom Taxonomy archive returns 404
- Query not returning CPT posts
- Pagination gives 404 error
- WP_Query pagination using only numbers instead of /page/1 on URL
- Unable to display multiple post types in same query (WPML WP_Query)
- Query for posts in 2 taxonomies
- Pagination with custom post types results in 404 issues
- Pagination not working
- Pagination Issue: Custom Post Type In Index
- Quickest way to get last or oldest post date – WP Query
- Custom query form submission pagination
- Paginated Taxonomy Term Archive including one post per term
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- Unable to get paginate_links working with a custom query [duplicate]
- Setting posts per page in query_posts
- Pagination on category page with custom post types
- How to add pagination to wp_query [duplicate]
- Sorting multiple custom post types without a meta key/value pair by sort order
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Pagination on a custom post type loop
- Display custom post type from dynamic custom field
- Query/list all terms and their custom post count
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Wrong request query on cpt and tax
- Previous/Next Link by Meta Value in CPT
- Pagination for Custom Taxonomy Page [duplicate]
- Pagination on with query_posts in custom post type template
- Get latest 3 posts from multiple CPT in one query
- Help with Elementor Pagination CPT archive 404 problem
- Custom taxonomy rewrite give pagination 404
- Woocommerce search pagination not working
- How do you paginate a query grouped by month?
- Polylang non-default language ignores tags in WP_Query
- Category with post type pagination returns 404
- Pagination issue on category.php using custom post type query
- Different Ways to Query Custom Post Types?
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- can these 3 queries be re-written as 1 query?
- How to display Related Posts based on number of taxonomy terms matched
- Custom post type pagination 404
- How to make WP_Query not to show irrelevant posts?
- Loop for custom post types filtered by a taxonomy
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Trouble with pagination
- Pagination 404 on Index with custom query
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- Pagination not working on custom query on a page
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- Custom post type and custom taxonomy 404 on page 2
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- Pagination for search results of custom post type [duplicate]
- Custom Post Type Archive Pagination
- All blog posts are not showing up
- Single parent post lists child posts with pagination
- Custom Post Type Query W/Category Dropdown
- Custom post type pagination error
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Sorting the Loop by Taxonomy Value
- Pagination not working on homepage
- How do I paginate a custom post type listing on a custom template page?
- Fourth page of custom post type archive page does not exist
- Pagination broke after updateto WordPress 3.4 [duplicate]
- WordPress custom post type post and category links 404
- Archive page – problem with pagination
- How do I correctly query posts from a post ID?
- How to exclude certain portfolios from a loop
- Pagination on category pages using wp_pagenavi causes 404 errors
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Display ACF object field data using Elementor Custom Query
- Assign a tag to custom post type using a query
- Custom post type category pages pagination returns 404
- Query Multiple Post Types and Paginate Newly Created List
- “Page not found” while on page 2 from pagination menu
- Create an archive page by combining two post type