Hide load more button if no more post in selected category

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, … Read more

comments_template() doesn’t work with ajax call

I partially resolved adding this code: $args = json_decode( stripslashes( $_POST[‘query_vars’] ), true ); $args[‘paged’] = $_POST[‘page’]; //Set Query Post args query_posts( $args ); //Set Glboal Post Data global $post; $post = get_post( $_POST[‘post_id’] ); setup_postdata( $post ); //Set global $withcomment = true to execute comments_template() – using comments-ajax.php Template (Root Folder Theme) global $withcomments; … Read more