You are doing the right thing. In theory you can probably intercept the “normal” API request and modify the relevant wp_query
to whatever you need, but this will mean that you are changing and overriding that API and if you will need it in its “virgin” form at some point it will not be available.
As for pagination, it is true that you need to make your own, but it is actually much easier to do that than on the HTML front end, all you need is to keep the page number in your JS handling routine and send the requested page as part of the request.
Related Posts:
- Custom post type pagination 404 fix?
- Mixing regular and custom post types (with meta_query) on home page
- meta_query for keys that aren’t yet set
- Get posts based on meta key/value
- How to create a wp_query that contains both meta_query and tax_query
- How do I Paginate Search Results for Custom Post Types?
- Custom Post Type Pagination Not Working On Archive Page
- Ordering posts having multiple post-meta date fields
- Archive page…limiting posts per page
- Order Posts by Taxonomy and Meta Value
- Shortcode Displaying Custom Post Types
- Related posts by author pagination not working on the production site
- Pagination go to first page if i’m on last post
- Pagination throws 404
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Pretty paged permalinks in custom post type loop
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- custom post type paging not working past page 3
- Custom Post Type, Two categories, Two columns with Pagination
- Pagination gives 404 error
- query order by date on custom type: wrong order
- Creating a simple pagination for custom post type templates
- Used with meta_query in query_posts works slowly
- WordPress rewrite my URL when i use pagination
- Custom Post Type Pagination & duplicate posts
- Display custom post type taxonomy and month
- Meta_query with relation ‘OR’ killing server CPU
- Repeating posts when paginating random posts
- How to add pagination to wp_query [duplicate]
- Pull a post based on a meta value in a custom post type
- Hard code the nextpage tag into my theme?
- Pagination of Custom Post Types not Changing Posts
- Why is this query not working? (Standard posts + custom post type)
- List all posts in a custom post type with pagination (the correct way)
- Category with post type pagination returns 404
- Pagination issue on category.php using custom post type query
- search suggest – filter post type
- Is it possible to to use custom post type types on a page with the same slug somehow?
- WordPress custom post query with pagination
- Meta Query posts not showing on ending date of custom field
- Custom Theme With Custom Loops
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Possible to filter custom post type with multiple meta data?
- can these 3 queries be re-written as 1 query?
- Number of posts in the archive
- WP_query – Filter by tax_query and meta_query using multiple select
- Is it possible to load a different sidebar in single.php based on a meta_query filter?
- Querying multiple values from a single key
- find custom post type post by searching its custom field with my string
- Query for post and costom post_type in same category filtered by meta for post_type
- fetch custom post by meta key if key value is does not know
- Pagination for custom post types – url rewriting
- WP_Meta_Query object with conditionals
- next page with custom post
- Difference between page and paged
- Using WP meta query to show custom post types by a start and finish date
- Pagenavi Plugin and Custom Post Type – Multipage results
- How to order query results based on if a custom field has been populated, then the order by the date of the post?
- order the meta query results by 2 custom fields
- Pagination links for custom post type shows correct number of links, but links result in Page not found
- Pagination for custom post type giving 404 error (but only for news page)
- how to skip a CPT element from the pager by custom field
- Pagination not working in custom post type. Help
- build child and anchestor three from post parent
- Custom query result empty on page 2
- Meta query and compare “!=” not working as expected
- Remove custom taxonamy slug with pagination
- Show posts from WP Custom Post Type selected from a field in a metabox
- Add Pagination in custom Blog page template
- Custom post type, next and previous links by page title
- meta query multiple values for the same key
- WordPress custom post type taxonomy paging
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Custom post types – meta_query: search lesson which starts sooner
- Custom Post Type canonical link / pagination redirecting to root
- Use WP pagination functions on a custom page template
- How to add pagination to a post loop in a custom BuddyPress tab
- Not able to get my custom search result using meta_query and tax_query together?
- Post navigation doesn’t show (in custom template, custom post type, custom query)
- Custom Pagination based on Custom Post Type
- Paginate Custom Post, Old and New buttons not displaying
- Querying, storing, and using data from 2 separate custom post types
- Pagination in custom post type page template
- 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
- paging is not working properly on news archives page [duplicate]
- using post_type with meta_query
- Paged within a custom content type template [duplicate]
- loop through custom post-type with two meta_keys
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Problems with pagination for a custom post type
- See the process of creating a taxonomy and tell me where I made a mistake
- add_filter > posts_where works partially
- get content from json api to post
- Pagination for custom post type on multisite not working
- the_post_navigation in single page with multiple taxonomies