I think next_posts_link()
is using the global $wp_query
to determine pagination, but you’ve created a new query here. Try passing max_num_pages
from your $loop
query to it:
next_posts_link( '<span class="nextpost">Next</span>', $loop->max_num_pages );
Related Posts:
- pagination not working for category.php (custom post types in categories)
- Pagination Not Working When Used With WP_Query() `offset` Property
- Fourth page of custom post type archive page does not exist
- Pagination not working with custom loop
- Display all posts in a custom post type, grouped by a custom taxonomy
- Have different number of posts on first page
- wp_pagenavi() with custom wp_query()?
- Custom post type archive 404’s with paginate_links
- Display several random posts, but make sure a condition is met
- Number of pages – multiple (custom) post types
- Custom permalink with pagination
- Retrieving 3 latest post from each of 5 different custom post types
- Newer/Older posts links display same posts on every page
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- How to create posts (not post template) to be displayed on projects page?
- WP_Query post at custom position
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- WP_Query pagination using only numbers instead of /page/1 on URL
- Query for posts in 2 taxonomies
- Pagination with custom post types results in 404 issues
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Custom query form submission pagination
- Paginated Taxonomy Term Archive including one post per term
- Impossible to get Attachments Outside WordPress?
- Help Structuring Query for Archive Pages
- Loop on front-page.php
- wp_query to find posts by year and month
- Custom Post Type Loop within Shortcode
- Pagination on category page with custom post types
- Query custom post type in the loop
- Loop through Custom Post Type, and then show children within each iteration
- Very Slow Page – How to Optimize # of Queries?
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Display CPT posts based on specific taxonomy
- How to make sure content doesn’t display if selection is empty
- Previous/Next Link by Meta Value in CPT
- Woocommerce search pagination not working
- WP Query with categories only shows one post and ignores the category
- can these 3 queries be re-written as 1 query?
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Sort posts in loop by the WooCommerce Membership of the author
- Pagination Error : Duplicate argument being outputted
- Custon Content within WordPress Loop
- Loop increase number
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- postsperpage value not being applied
- Pagination for search results of custom post type [duplicate]
- foreach loop inside the loop creating duplicates in output
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- All blog posts are not showing up
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom Post Type, Pagination and 404s?
- What is the most efficient way to execute recursive complex queries?
- 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
- Numeric pagination custom post type
- Problems in paginate_links with custom query loop and MB-Relationships
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Make pagination work as a carousel (custom query)
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- subtracting the current post form then whole loop, which is generating all CPT titles
- Mix Facebook and Twitter feed into custom posts
- sorting in wp query based on custom field value
- Custom post Query and WordPress Post Query Clash
- WordPress loop add heading before first of type
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- get_post_meta for Custom Post Type ( CPT )
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Is it possible to add query parameters on the archive page?
- Loop with Custom Post Type and Taxonomies
- display news with pictures 3 small and one large (loop)
- Custom post type archive pagination with HTML5Blank theme?
- How can I pull information from my loop and divide them seperately?
- 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
- Pagination not working with custom loop
- Fallback if statement based on the number filtered from it
- Pagination not working with custom loop
- Pagination not working with custom loop
- Pagination not working with custom loop
- Pagination not working on homepage
- send user to first page of results when reposting to page?
- Query Custom Post Type by Tag
- Pagination broke after updateto WordPress 3.4 [duplicate]
- Catergory args causing loop not to show
- Unable to display paging navigation with a custom post type loop
- WPNavi pagination links not working on custom pages