next_posts_link()
and previous_posts_link()
use the global $wp_query->max_num_pages
to determine if there are more pages. since you’re using a new instance of WP_Query
, the $wp_query
global does not relate to this new query.
Try explicitly passing $loop->max_num_pages
to the function:
next_posts_link( 'Next' , $loop->max_num_pages );
or if you’re not using the original query, call query_posts()
with your arguments instead of creating a new WP_Query
instance.
EDIT – also, as @kevin mentioned, posts_per_page
set to -1 will load all posts, so you’d have to change that as well for it to paginate.
Related Posts:
- Categories and Tags not working!
- CPT Archive with core Category
- Custom Post Type Custom Archive Page Not Working
- Custom post type category permalinks and archive pages
- CPT archive page – show one post from each taxonomy term
- Only show categories that have posts within custom post type
- Custom post types not displaying per category
- How to Show all Values in category.php page using post_type
- Help with Multi Level Category Archive Page
- How can I set up the URL for a category archive for a custom post type?
- Show custom post type on post category page doesn’t work / breaks navigation
- Number of Custom Post Types published are not being shown in the custom page
- WP Query with categories only shows one post and ignores the category
- Custom post type archive page blank
- Adding custom post type to count in category
- How to edit this code to get the categories in achieve page?
- Category with post type pagination returns 404
- Custom Post Type and Category Base Rewrite Issue
- Custom Post Type has_archive
- Get the category from custom post type
- Post injections into Site Origins Page builder [closed]
- Custom Post Type + Categories
- Custom Post Type Archive URL is wrong
- How to create a gallery page with categories?
- Creating a Custom Post Type
- Custom Post Slug same as Parents Category Slug
- WordPress posts page for customer filtering and sorting along with category filter
- I am having Trouble to get list of Categories of Custom post Type
- Hierarchy and access control for Custom Post Types (CPT)
- Multiple (two) category postings on the same page.
- Custom Post Type slug same as page name
- Loop filtering Custom Post Types and/or Categories
- How to display custom post in archive section of the wordpress page?
- Content Editable CPT Archive?
- School & class blogs: Categorize with categories or custom posts?
- Custom post type and category link together
- list archives per post types
- Why is my category template ignoring post type?
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- How to get custom posts sub category link
- Canonical url differs from custom post type archive URLs
- Not sure if I should create multiple custom post type [closed]
- Cross reference custom post types
- Display a custom posts page for post type
- Make a custom_post translatable
- Pre-selecting the category for a custom post type
- Custom post type archive pagination 404
- posttype/taxonomy/term archive page 404 error
- Is it possible to have a custom post type with feed but without the archive?
- browse by category and tags?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Categories filtering in new post
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom post types and category archive
- List of Posts and Categories
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- How can I show 1 featured post in a styled element, and the next few below differently styled
- How do you create a custom template to display a category with an image and related posts below?
- How can I list Custom Post Types created with the Types plugin under categories?
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- Paginate_links in custom post type template
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom templates for a specific category
- My archive-posttype.php template is not loading
- CPT category hierarchy
- Custom Post Archive is not working
- Categorise Custom Post Types
- WP the_posts() on single-cars.php get category link
- Category.php template for custom posts
- Limit the Title Length on Custom Post Type Archive Page to a Set Number of Characters
- Custom post type archive with page as parent url
- How to retrieve category of a post in have_post loop?
- Add parent post to Custom Post Type [closed]
- Set featured image to archive.php
- Categories and tags for custom post types
- Create new custom post and post category of same name
- Tag page only display 10 posts
- category page for custom post type
- in_category for custom post types
- What’s the name of the custom post type yearly archive template?
- Get parent category id from child category page for custom taxonomy
- Custom post type, global categories — what’s the template name?
- Getting used tags per post type
- Archieve.php not loading for custom post type
- multiple custom post type on category page
- How to hyperlink content from archive page with custom post-type
- Category archive in with conjunction with custom post type is empty
- Set thumbnail and title for a post type archive (not post itself!)
- Can I restrict category availability?
- WP_Query Custom Post Type if Category ID Equals
- Why does accessing url by category cause issues with post types?
- How to set up Custom Post Type archive page as Front page
- Url to archive page for custom post type
- Custom post types and ‘new WP_Query’
- How can I have different content for different countries?
- How can I use archive-{post_type}.php theme template?
- How to add current custom taxonomy slug to body class
- How to display CPT archives?
- Assign category a default post type