Where is this code? It’s hard to tell without more info, but it looks like you’re trying to change the main query but are just running a new one. If so, you should be using the pre_get_posts hook. Otherwise your paging links will reflect the main query (which is what you want to modify) instead of the new one that you’re showing on the page.
Related Posts:
- Custom post type archive 404’s with paginate_links
- Number of pages – multiple (custom) post types
- Custom permalink with pagination
- Related posts by author pagination not working on the production site
- Secondary loop pagination on custom post type single post gets redirected to first page
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- custom post type paging not working past page 3
- WP_Query pagination using only numbers instead of /page/1 on URL
- Pagination not working
- Pagination Issue: Custom Post Type In Index
- Custom query form submission pagination
- Paginated Taxonomy Term Archive including one post per term
- Unable to get paginate_links working with a custom query [duplicate]
- Pagination on category page with custom post types
- How to add pagination to wp_query [duplicate]
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Pagination on a custom post type loop
- Previous/Next Link by Meta Value in CPT
- Pagination for Custom Taxonomy Page [duplicate]
- Pagination on with query_posts in custom post type template
- Custom taxonomy rewrite give pagination 404
- Woocommerce search pagination not working
- How do you paginate a query grouped by month?
- Pagination issue on category.php using custom post type query
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- can these 3 queries be re-written as 1 query?
- pagination not working for category.php (custom post types in categories)
- Custom WP_Query always respond with 200 status even when no entry
- 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 and custom taxonomy 404 on page 2
- 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 pagination error
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- custom taxonomy pagination 404 error
- Pagination in custom post type archive.php not working
- Pagination Not Working When Used With WP_Query() `offset` Property
- Numeric pagination custom post type
- Problems in paginate_links with custom query loop and MB-Relationships
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Make pagination work as a carousel (custom query)
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- why custom post archive gives always no more than 10 posts despite of paging settings?
- query and paginate multiple post types
- Custom post type blog pagination conflict
- Custom post type pagination, single page issue
- Pagination always adding “Next” link when results come from Custom Post Type WP_query
- Paged within a custom content type template [duplicate]
- Pagination not working on homepage
- send user to first page of results when reposting to page?
- Fourth page of custom post type archive page does not exist
- Archive page – problem with pagination
- Query Multiple Post Types and Paginate Newly Created List
- “Page not found” while on page 2 from pagination menu
- get_query_var() not working in pre_get_posts
- WP_Query ignores post_type in category view
- Filtering a WP_Query meta_query by numeric values isn’t working
- Query for posts from any post type but only add instock products
- Query not returning CPT posts
- Unable to display multiple post types in same query (WPML WP_Query)
- How to use custom post type APIs, but use a different db table
- Display all Posts and only certain Custom Post Types with meta fields
- Lists Posts from CPT that match the Title of the Page
- Returning a list of custom post types excluding those without a specific meta_value
- query private custom post type
- Randomize Posts. Skip the first post in ascending order
- Paging doesn’t work?
- Get Posts by multiple custom fields is not working
- How to have this permalink structure: post_type/postname/custom_inner_page
- Sort entries by date mixing two post types
- How can I group posts by months and years?
- Can’t use pagination with custom taxonomy
- Display post from a date range from custom field
- Displaying a div from an assigned meta_value when on a page
- WP_Query not resetting after wp_reset_postdata
- Custom post type to lead to single post type instead of shortcode modal
- Filter posts of custom post type by meta key in (List All Section)
- Display post from custom post type
- Query Posts, order by meta value
- Create if else for post types in WP_Query ‘post__in’ values
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- Query a custom taxonomy in a function to create an csv file
- Mix Facebook and Twitter feed into custom posts
- Pagination URL in Custom Content Type
- pre_get_posts gives 404 error on Custom Post
- Get post from Category by Priority
- WordPress loop multiple orderby query with Types toolset
- Get posts associated with custom taxonomy alternate way
- tax_query showing no results
- Can’t use orderby in WP_Query
- How to display elements of different post types?
- display post types alternately
- Query Custom Post Type by Tag
- WP Query – Can’t get posts with specific taxonomy