next posts link is somewhat pointless since you’re paginating with ajax, no? have a look at the code from the answer to your other question at how I paginate the query-
var postoffset = $('.post').length;
that counts how many posts are on the page and then I pass that as the offset. in your case it would be .box
. when I put that in the query, I get back posts starting at that number:
$offset = $_POST['postoffset'];
$args = array(
'offset' => $offset,
'posts_per_page' => 10
);
$wp_query = new WP_Query( $args );
that way I can just use the same button to load more posts, it just repeatedly calls the same function, checking how many posts are on the page each time.
Related Posts:
- Search – Ajax – Alter Query Parameters with Pagination
- WP_Query ajax loader detect end of posts
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- how to handle multiple ajax wordpress queries?
- How to filter a static post page with ajax and $wp_query
- Ajax (jquery) wp_query pagination returns -1
- Duplicate posts showing up in loop using infinite scroll
- Pagination on a WP_query not showing navigation links
- How to paginate wordpress [gallery] shortcode?
- paginate_links ignore my format
- wp_query->max_num_pages always returns 0 on custom post type
- How to paginate attachments in a secondary query as gallery?
- Query causing load because of SQL_CALC_FOUND_ROWS post counting?
- Load more AJAX on WP Query
- pagination doesn’t show up for custom post type
- Pagination causes error 404 when used with front-page.php
- How to pass custom parameter to WP_Query for filtering in pre_get_posts
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Paginated pages are showing correct content but pagination links are not
- Pagination wont work with search results template [duplicate]
- Pagination Not working on Home Page with 2 Query
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- Best Practice For Querying Grandchildren?
- Using AJAX to return search form results
- Two queries on the same page with pagination
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- Add custom search results to main WP search [duplicate]
- Pagination doesn’t work in custom page template [duplicate]
- WP_Query pagination not working in admin area
- How to get user_id from wordpress database inside ajax function?
- WP_QUERY loop, offset in the arguments and the paginate_links – can these work together?
- Update Loop with Form
- Pagination working everywhere but the index page
- Refine/Filter WP_Query Posts with jQuery or Ajax
- Show selected images on top in Media Manager
- Storing query variable and then using wp_reset_query
- How to set pagination to work with ‘/page/’?
- Get pagination working for custom loops within page templates
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- Using ajax with paging and a custom sub-query
- WordPress Pagination changes my template
- pagination with ‘no_found_rows’ => true,
- Ajax WP_Query reutrns no results on author.php
- WordPress pagination not working on template search.php
- Pagination links missing for first link (1) and previous button? How to get pagination links to work?
- How to return a 404 when custom query matches nothing?
- Pretty urls for custom pagination
- Multisite pagination issue by multi query archive 404
- Custom Pagination in Shortcode with WP_Query
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- Ajax future single post query doesn’t work when NOT logged in
- Append URL query to next post link in custom query
- new WP_Query messes up pagination
- Pagination is not working with custom query inside a homepage template
- Display single most recent post in category on every page of category archive
- Pagination works in custom query loop but it doesn’t work in shortcode
- Page navigation doesn’t seem to work when I add offset?
- How to use a dropdown to filter posts by custom field
- Retrieve data from wordpress db via input and put those result in dropdown
- Content not displaying on paginated page
- WP_query is not returning the expected result
- I need to run a AJAX Fuction from within a WP_Query but only works on first item
- Adding pagination to sub-wp_query within a singular post page
- WP_Query and pagination AGAIN?
- Reciving Error 404 blog/page/2/
- wordpress pagination wont render on custom page template even though its right under the loop like the documentation says so
- Using Ajax and WP_Query to load more posts on category page fails
- Load more posts using AJAX based on posts inside WP_Query
- Pagination repeating posts on search results
- Filter admin ajax data by url query
- Pagination for Category does not work
- Load WP Query with Ajax
- pagination functions are not working
- WordPress pagination not returning posts on second page
- Paginate nested query of child posts
- Is instantiating WP_Query not possible within an admin Ajax call?
- WordPress conflict with multiple load more posts functions on click
- Show All with Isotope
- Search Filter With Custom Taxonomy and Custom Fields : How do I handle it via plugin?
- how to avoid reloading/refresh the page when displaying the post of wp_list_categories
- 3 wp_query on one page with pagination for last query
- Custom pagination (Title, date and teaser)
- WP_Query for liked posts is showing all posts if none are liked
- Declare inline background image in functions.php
- custom query – offset to pagination
- Pagination not working with WP_QUERY
- Add pagination to table generated by wp_query
- Pagination in custom query in a category page
- Fire query on ajax post url page
- What is wrong with this pagination code?
- wp_query pagination links producing 404
- Can’t get pagination to work with this WP_Query loop
- Pagination in custom loop [duplicate]
- Pagination in WP query with transient API
- Multiple loops on index page with sticky post and pagination
- Pagination problem with multiple loops on the same page
- Pagination not working in secondary query
- WP Paginate not working properly
- WordPress WP_User_Query ignores the `meta_query` when called from an Ajax function
- Limit paginated result set to a maximum number of posts