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
- Get custom post type slug for an archive page
- Custom Post Type Settings page, choose page to display archive
- Adding custom post type archives to a WordPress menu
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Custom Post Type Archives by Date with Custom Permalink
- What are the advantages of using a custom post type archive?
- category__in not working on custom post type
- Custom Post Type archive as front page
- how do I group content in magazine-style ‘issues’?
- Use standard WordPress categories with a CPT
- Adding custom post types to archive.php
- How can I add single catogory for custom post type?
- Get the post_type of current taxonomy or category page
- How to make an archive page displaying posts in a date range
- automatically save custom post type title as a category
- WordPress custom post type archive with description
- get_categories() for only CPT
- category.php displays ALL posts instead of just those with the current category
- custom taxonomy archive by year
- Archive page for custom post type not working
- Editable content on a Custom Archive page
- An empty Custom Post Type Archive page returns 404 in WP 3.1
- How to add custom post types to normal category pages
- Pagination on category page with custom post types
- Call custom post type by category
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- get the custom post type title/name
- Show custom post type filtered by category
- Displaying Page as Custom Post type landing Page
- Filter CPT posts by one or more categories
- CPT archive admin menu label
- WP Query with categories only shows one post and ignores the category
- Custom Post Type + Categories
- Hierarchy and access control for Custom Post Types (CPT)
- Loop filtering Custom Post Types and/or Categories
- Content Editable CPT Archive?
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- How can I show 1 featured post in a styled element, and the next few below differently styled
- How can I list Custom Post Types created with the Types plugin under categories?
- Paginate_links in custom post type template
- Limit the Title Length on Custom Post Type Archive Page to a Set Number of Characters
- Categories and tags for custom post types
- How to hyperlink content from archive page with custom post-type
- How to add current custom taxonomy slug to body class
- Meta data (Tags and Categories) for Custom Posts not showing.
- Custom post types with categories in template
- The Difference Between Categories and Tags and Taxonomies and Terms
- Get assigned post categories
- Default Category Page not showing custom post type which has taxonomy category
- Custom Post Type posts not showing in category
- CPT Archive pre_get_posts not working?
- Post Query not working
- Category Name with Custom Post Type
- Am I mixing up the concept of posts pages and categories?
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- how to organize my categories or should I do custom post types for some?
- Order Categories by Hierarchy?
- Multiple categories assigned to a single product breaking the breadcrumb
- How to set a ‘page’ as parent of a custom post type?
- How to divide Subcategories into pages of parent category wordpress
- Custom front-end form for adding post – Category problem
- Custom post type archive page filters
- Custom Post Type Category Displaying ALL Sub Categories as well
- Control over custom post types on a specific page
- Displaying all posts by category and showing content on click
- create a “add icon” field in taxonomies page
- Feature image Gallery made from Custom Post type + Categories
- Tell wordpress to show a single page instead of an archive page
- Get meta values from parent post and save in child post
- Custom post pagination not working
- Use Category for Custom Post Type – But Need Another Separate Archive Page too
- Custom post type post_type_link gives “page not found” on any other custom post type
- Only show current category post
- how to use two permalinks for one custom post type based on categories
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Rewriting archive page slug to be different than custom post type slug
- Site loads very slow for archive custom post type page
- Custom Catagory not found
- Page to show custom posts and one category
- Have two (permalinks) urls for a same custom post type
- How can I list custom post by custom category?
- how to show perticular category posts in custome page
- Use only selected regular categories for a Custom post form
- Bulk remove category from custom post type?
- Problem with menu categories doubling up when updating database?
- Remove slug from Custom Category Permalink + dual-category permalinks
- How to query posts by category with the_title();
- Can WordPress show posts based on a button that the user clicked 2 pages back?