First things first, you’re throwing away the default query for the page (after it hits the DB and sets up the globals) with your custom query. The pagination is referring to the default query for the template, which is defined in Settings > Reading, plus you’re hitting the DB twice for the same thing, which is hideously inefficient.
If you want to change the options of the main query for a template you should hook into pre_get_posts
and modify the default query before it’s sent to the DB, like so:
add_action('pre_get_posts', 'wpse276456_custom_tax_query');
function wpse276456_custom_tax_query($query) {
if(is_tax('page-name') {
$query->set('posts_per_page', 1);
// Add more calls to $query->set as necessary
}
}
Related Posts:
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Custom post type archive page pagination
- Unable to get paginate_links working with a custom query [duplicate]
- Pagination for custom php code
- Page vs Custom Post Types Differences/Issues
- How do you paginate a query grouped by month?
- Cant get paginations on single.php to work with my custom post types
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Pagination hitting 404 page on /page/4
- Custom post type and custom taxonomy 404 on page 2
- pagination for custom post type archive page
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- Pagination not working in custom post type. Help
- pagination problem listing custom post types of taxonomy in wordpress
- I want to create pagination for my custom post type archive that i am displaying with loop
- Post navigation doesn’t show (in custom template, custom post type, custom query)
- Pods pagination erases my sub menu
- Paginating custom query on category template
- Custom pagination [duplicate]
- Pagination not working on homepage
- Pagination not working for archive
- Two pagination in one page without AJAX
- Custom post type removing /page/2/ from URL when trying to access it
- Blog page showing same content as homepage
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Setting posts per page in query_posts
- Custom post type, permalinks & pagination, going wrong
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Admin notice not displaying
- Can’t get order_by meta_value_num to work properly
- Create custom post type on successful woocommerce order [closed]
- Repeating posts when paginating random posts
- Pagination on category page with custom post types
- Adding custom tables to WordPress
- How to add pagination to wp_query [duplicate]
- Archive template for custom post type only lists first 10
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- CPT: if more than X images are in post, use pagination
- Very Slow Page – How to Optimize # of Queries?
- Dynamic page outside WordPress
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Using wordpress template tags within an array
- Hard code the nextpage tag into my theme?
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Getting the URL of the parent page
- Custom query to filter posts that have current post as a taxonomy [closed]
- Custom post type permalink returns bad url
- Return the thumbnail meta data for getter and setter
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- get_posts of Custom Post Type AND Custom Taxonomy
- What’s the difference between same wp functions get_posts(); functions in different form?
- How can i change the output of posts_nav_link();
- Pagination on a custom post type loop
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- How to alter WP-JSON main query or best practise for custom endpoints
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?
- Get posts from a custom post type by child categories of a parent category
- Pagination is not working in custom post type
- Received nothing after executing AJAX post function
- How to make sure content doesn’t display if selection is empty
- Custom Post-Type not in admin menu
- get the custom post type title/name
- If post has custom field then display css-class
- How to display all posts from standard posts to custom post types in a loop with pagination?
- Push metadata in array
- How to customize a permalink (URL) structure?
- Troubles with saving metabox
- CPT + CMB2: data not displaying for only first post in loop
- How to make a field appear only if a post meta field has a defined value?
- Replace text in post from cvs
- Get parent categories of custom post type
- Previous/Next Link by Meta Value in CPT
- Can I list a custom post type within another custom post type in the admin area?
- Custom post type not displaying all entries
- Get custom post type list for every category shortcode
- Custom post type (with parent-child relationship) singular page with pagination
- Pagination for Custom Taxonomy Page [duplicate]
- How do i calculate the total of values of custom fields in custom post types?
- Pagination on with query_posts in custom post type template
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Pagination of Custom Post Types not Changing Posts
- Query & Order posts by custom fields
- Paging doesn’t work?
- Custom post type – get_day_link()
- Set URL link to featured image of custom post type
- Custom Tag Description unable to display just below and outside of the Loop
- AJAX load more for different custom post type loops
- Help with Elementor Pagination CPT archive 404 problem
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- How do I move/order posts with a tag to the end?