I believe you should pass one more label “How many posts remain to be seen” in your $response
array in function filterPosts()
You know the total number of posts based WP_Query that exist in the database
$filter_query = new WP_Query($filter_args);
$total_query_posts = $filter_query->found_posts;
So, then you have to calculate it based on paged
and posts_per_page
, pass the remain number posts in the other variable and then make an if condition in your js to hide the button
This is a quick thought
Related Posts:
- get_queried_object error How to show post count by month in the taxonomy page
- WP_List_Table Inside Metabox Not Working on Submit
- How to filter post data with AJAX on page?
- Showing current taxonomy terms
- Custom permalinks – post type – hierarchical taxonomy’s
- taxonomy list display custom post count
- Ajax filter with custom taxonomies
- automatically create taxonomy with same name as post title
- Filter posts with ajax form and checkboxes
- Custom Post Type Category List & Post Count
- Taxonomy list. Order by a specific custom post type count
- Display taxonomy term only if there’s a value
- Adding Custom Taxonomy to WordPress default Post type
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Making pages also serve as taxonomies? Or give full pages to taxonomies?
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How to filter the taxonomy terms based on another taxonomy term
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Show Two custom Post type and their posts on category page
- Count posts with specific term_meta
- count_many_users_posts except current logged in user?
- Query/list all terms and their custom post count
- Received nothing after executing AJAX post function
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Storing posts from query and accessing later via AJAX call
- Loading custom content type from ajax results?
- Missing Posts in Custom Taxonomy List
- Disable block with taxonomies at post page
- Which post does a taxonomy term belongs to?
- List custom taxonomy specific to one custom post type
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Ajax Custom Post Filter is not filtering
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Get related posts of child term of custom post type
- Post count by month of taxonmy term
- JS innerhtml changing style when using AJAX
- custom post type category count shortcode
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Load Custom_post_type categories post with ajax
- Load Next Posts With AJAX not working with custom post type
- Retrieve custom post types by custom taxonomies with WP_Query
- WP the_posts() on single-cars.php get category link
- $post not working working in AJAX plugin with custom post type
- Load Next WordPress Posts With AJAX?
- Custom post type’s extra fields – how to handle?
- Variable not working in WP_Query
- How to Display Posts From Category Within a Custom Taxonomy?
- I am trying to get cutom post cout by month of current taxonmy term
- WordPress notification if new post published
- filter by custom taxonomy using ajax
- display posts of custom post type with custom taxonomy
- how to count the current posts terms
- How to count other posts not having specific taxonomy terms?
- WordPress Count posts within a custom post type
- How to query Posts from a custom post type which contains a custom taxonomy?
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Different structure/content for posts from a custom post type
- List all posts in taxonomy term
- custom taxonomy listing returns no posts
- Display custom post counts for author , not default posts
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Not saving custom taxonomy while using ajax
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- display post count in archive page that have relation with another taxonomy term
- What is the best way to structure posts for the same event happening in different years?
- Right way to store a large set of similar information on website? [duplicate]
- Define multiple prefixes for custom post type
- How do I find the count of the current post?
- get_queried_object not work in taxonomy page
- Get queried object for custom post type count
- How to show custom post count in archive page
- How to display custom post type pagination buttons when processing AJAX request
- I cannot display custom posts in custom taxonomy
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Show ajax form resuslts in page
- How to manage a dynamic multi-level page hierearchy system?
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Ajax load more inside custom post type taxonomy
- How can I get the last 5 element of this tax query?
- Display title of all custom posts from same taxonomy term on a custom post template
- How to get all posts related to a taxonomy?
- Filter By Term Not Working – Custom Post Type
- Custom Post Status & Taxonomies
- Post Editor: display categories from current post type taxonomy only?
- Linking custom taxonomies and posts
- How to Associate Posts with Pages
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Custom filtering on month value only of an entire date field
- Custom My account page and custom page for editing posts
- update custom taxonomy with Ajax in edit.php file [duplicate]
- Get custom post type parent category
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- How to filter custom post data with AJAX?
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- How to develop Knowledge center in WordPress Website
- ACF – Tags not showing up in Custom Post Types
- How to get_term_meta on single custom post?