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
- Search that will look in custom field, post title and post content
- Archive page…limiting posts per page
- Date archives for custom post type
- If featured image doesn’t exist, show post content
- How do I redirect all 404 errors of a specific post type to another URL?
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- How to save the checked boxes?
- Custom Post Type, Two categories, Two columns with Pagination
- Pagination gives 404 error
- Error after deleting Custom Post Type with a function (no trash used)
- Append taxonomy terms as class names in markup?
- Change message given when deleting post from custom post type
- Using WPAlchemy metabox values in another metabox
- GravityForm: Populate Dropdown with custom post type [closed]
- How to output wordpress custom tags separated by comma?
- Admin notice not displaying
- Repeating posts when paginating random posts
- Dynamic page outside WordPress
- Custom query to filter posts that have current post as a taxonomy [closed]
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Custom Post Type Loop throws 500 error when used in widget
- Pagination on with query_posts in custom post type template
- I need to add endpoint for wordpress categories
- How to handle paged param in post and custom-post-type?
- Hide a widget inside a div on specific type of post
- How to import a custom MySQL DB table into a WordPress custom post type
- Foreach inside shortcode not working as planned
- Custom Post Types strange pagination problem
- Displaying custom field according to date
- Custom post type pagination – always return first page
- Add additional field to custom post_type
- Set featured image to archive.php
- Get term name without a foreach loop
- custom post for slider
- Using wp_query to modify the loop in index.php for a CPT
- Get custom post type categories to show up in menus
- How exclude or skip post type with get_next_post_link
- Create short URL with auto 301 redirect
- Is it possible to use array_walk() to append terms to an array of posts?
- Creating shortcode id for custom post types
- List latest post out of 2 custom post types
- Pagination for custom post types – url rewriting
- Pagenavi Plugin and Custom Post Type – Multipage results
- On click some element i want to use some template
- Fetch data from two custom post types and create multidimensional array for output to html table
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- How to get the custom post data using post id in WordPress?
- See if the email exists or not
- On saving Post My permalink is updated and category is removed automatically which cause the 404
- How to add specific terms in a custom post type?
- Limit custom post type to the authors only on front-end!
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- programmatically generated custom post type is created more than once
- Remove custom taxonamy slug with pagination
- Create posts inside CPT post
- Taxonomies are not showing in the category dropdown
- Add Pagination in custom Blog page template
- Combine multiple separate lists into one
- Custom post type, next and previous links by page title
- Custom Taxonomy – fields
- Print post category name from a custom post type wordpress
- How to add pagination to a post loop in a custom BuddyPress tab
- CPT post doesnt shows tags and category on backend admin page
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Get month and day from a Date Picker custom field
- How to display data with pagaination on backend?
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- 404 error Custom search results page for custom post types with friendly URL
- previous_posts_link returns null when querying custom post type
- Custom Post Type Pagination for Bones Theme [duplicate]
- Pagination with Custom Post Type
- Paged within a custom content type template [duplicate]
- Select Menu for Custom post Type does not save
- is_singular won’t call my functions?
- Inserting two categories
- Comments are not working on Custom Post Type
- Send email on creation of custom post type and use get_post_meta()