You should use the pre_get_posts
action to get the correct number of category pages and links.
The complete solution is explained here.
Related Posts:
- Five posts from a category in footer
- Function the_posts_pagination() not compatible with WP_Query arguments
- adding pagination to a foreach loop in wordpress
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- Pagination only showed when no category is set in wp_query
- “paged” in WP_Query returns 0 posts
- Pagination on category.php and tag.php not working
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Pagination on template page for custom query redirecting to index.php
- wp_query is showing posts from other categories
- WP_Query Taxonomy categories filtering
- Yoast primary category query modification
- Hide products in uncategorized category from search results
- How to load a script code only in posts?
- Page navigation doesn’t seem to work when I add offset?
- How to echo woocommerce category name
- How to display a list of posts in same child category as current post
- Notice thrown when creating numeric pagination on custom query
- Slider won’t work with custom query
- WP_Query with one category in args shows other categories
- How to exclude a category name from showing?
- Pagination in html table is not working
- Content not displaying on paginated page
- Loop categories by recent post
- How order posts from category by date and comment count?
- Get the child category ID of current category
- How to get posts by category and by choosing a taxonomy term?
- Related Posts Excluding Certain Categories
- Paging + WP Query
- Getting the permalink to the latest post from a category
- What is wrong with my WP_Query Arguments?
- WP_Query custom order and pagination
- Second loop pagination changes URL, not content
- Unable to paginate a custom page query
- I am officially missing something about transient posts
- Query Not working as expected
- WP_query paged pagination with excluded category still counts it
- max_num_pages says 4, yet I am only able to navigate to the third page
- Custom Homepage Pagination using WP_Query
- Paginate pages with dynamic query
- filter posts by meta key with pagination
- Determining what post is displayed out of total posts found
- Trouble Making WP_Query paged
- Widgets: Show Recent Posts Only if the Posts Have Both Categories X and Y
- Adding pagination to sub-wp_query within a singular post page
- How to filter a static post page with ajax and $wp_query
- Pagination problem by using WP_Query
- Ajax (jquery) wp_query pagination returns -1
- WP_Query and pagination AGAIN?
- WP_Query Pagination
- WP_Query, Paginate by Custom Field
- get_the_terms has strange result since version 6.0
- Post incorrectly excluded when using “category__in”?
- Related posts by current posts child category
- Reciving Error 404 blog/page/2/
- Filter sub-category from checkbox form
- Why is my pagination /page/2 taking me to index.php?
- `offset` WP_Query argument dont work via `pre_get_posts`
- Use get_cat_ID to retreive multiple category IDs
- Filter products on category AND tag
- duplicated posts when using pagination
- paginate_links appearing on page but it doesn’t actually paginate – pagination on a static page with a dynamic `post_type` argument on a static page
- wordpress pagination wont render on custom page template even though its right under the loop like the documentation says so
- Pagination of custom page with custom fields query
- query hook parse_tax_query function takes no effect
- pre_get_posts pagination not working
- How to use the Term Object from a custom select field in a query
- Pagination repeating posts on search results
- Pagination not working on archive.php template?
- WordPress Sub Category Archive, Show Extra Empty Page Number in Pagination
- 3 posts from each existing category on one page
- WP_query pagination on frontpage
- How to display the category dropdown auto search list when key press?
- Categories In English version showing not canonical URL, instead shows query search result
- Pagination unique to a widget
- What code to use in an array to call the current sub-category?
- Get categories within specific term
- Related categories order posts by category
- How to show specify category template for both parent and child category
- Pagination inside the blog page not working
- Why pagination is not working with tax_query param?
- Pagination on archive.php not working?
- paginate_links method doesn’t show second page of my custom wp_query
- Exclude parent categories from recent posts list
- Wp_Query Post per page not working?
- Display All Top Child Categories / Taxonomy
- Query post by Category and custom file (ACF)
- Pagination Shows Up But Won’t Work on Custom Gallery Page
- Custom Query Pagination not working on static front page
- Check the product in the cart from which category is and show message
- WP_Query showing all posts, except from category X, unless it’s also in Y
- 404 page on custom search pagination
- WordPress search page pagination displaying but not functional
- Single query for multiple categories
- Display 3 levels of categories on page
- Filtering ‘Featured’ posts from a batch of category IDs
- Show posts from categories instead of tags
- Multiple values in WP_Query : category__and
- Paging works correctly on local version, but not live?
- Pagination not working in custom loop WP_Query