The problem is that your query is selecting 10 posts per page, but you’re only limiting the view to 5, so you’re losing 5 posts per page. The proper way to change the number of posts per page is to modify the query before the loop:
<?php
$myquery = wp_parse_args($query_string);
$myquery['posts_per_page'] = 5;
query_posts($myquery);
if (have_posts()) : // etc.
Related Posts:
- Showing Custom Content in a Nav Dropdown
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- Adding categories to custom post type in permalink
- How to change permalink structure for custom post type and it’s taxonomies?
- Get the first post term
- How to show all posts of the category in wordpress?
- WP_Query by a category id and a custom post_type
- Filtering a custom post type by custom taxonomy in archive template
- Why are posts from custom post type not displayed in “category” archive?
- Remove current_page_parent nav class from blog index when in CPT
- Add Category Taxonomy Support to Custom Post Type
- Exclude a category from WP_Query
- Get category id from post id of a custom post type
- Custom Post Types on Category Pages
- Displaying category archive of custom post types
- Adding Categories to a WordPress Custom Post Type?
- Setting Default Category for Custom Post Type Upon Autosave
- Creating “static” taxonomies to choose from, inside custom post type?
- WordPress Custom Post Types with a page as a parent?
- How to display regular posts & custom post types that fall under a category using just the generic category template?
- How to order adjacent posts (prev / next) by custom field value?
- How can I list all the categories under a Custom Post Type (taxonomy)?
- How to model a hierarchy for courses, levels and lessons?
- How to build a complex page structure
- WP_Query ignores post_type in category view
- Add category to custom post URL
- Only list categories that contain posts of a specific custom post type
- Custom Posts Types using Posts Category
- Load custom posts with same tag as page
- How to filter custom post types by custom category taxonomy
- Hide/Show only specific categories in wp-admin new-post.php
- Is there a way to use regular categories with custom post types?
- How make get_next_post() return first post when viewing last one
- How to list all categories and tags in a page?
- category__in not working on custom post type
- Pagination not working with custom category template
- Get categories for a specific post – Custom post type
- Problem excluding category from get_next_post
- remove support for ‘Categories’ for a custom post type
- Remove date and category filters when editing custom post types
- how do I group content in magazine-style ‘issues’?
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Glossary with Custom Post Type
- How can you make permalink work for custom post type and taxonomy?
- Include custom post types in categories widget
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Filter get_categories() for taxonomy term in WordPress
- Categories assigned to custom post type not found
- How to get a list of term names of the custom post type im currently on in single.php
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Use standard WordPress categories with a CPT
- How to get dynamically custom post type that are under a certain category
- Anyway to assign custom post types to a specific category?
- List with categories, subcategories and posts of custom posttype
- Template tags to display custom post type posts in category template?
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Regex problem in an add_rewrite_rule
- Nav menu of all posts in a custom post type
- Listing and accessing categories for a custom post type
- How to show related posts by category or custom post type?
- Categories or Custom Post Type to Organize Content
- wp_list_categories and custom post types
- How can I add single catogory for custom post type?
- On clicking on the category name the page is redirecting on 404 pge
- Hook onto Add New Category
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- Custom Post Type, Two categories, Two columns with Pagination
- Structuring a product catalogue in WordPress [closed]
- New WP_query in template not working with CPT+category on some pages
- posts_nav_link on single post template
- Custom edit post column – category not showing
- Dropdown list of a custom post type
- Displaying custom post type on category pages but not on blog listings
- Highlight nav menu terms
- WP Query group/order by category name
- Automatic category for a Custom Post Type
- Get the post_type of current taxonomy or category page
- Taxonomy list. Order by a specific custom post type count
- Custom Taxonomy Breadcrumb Navigation
- How to show custom taxonomy in the permalink?
- Change / Delete the default post type and category?
- List all custom post type posts from a given category?
- How to customize the Categories meta box to allow only one category?
- Restrict categories to a custom post type
- Custom post type taxonomy template
- Categories and Tags not working!
- Custom/separate categories for custom post type
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- How can i list custom post type categories?
- Query Custom Post by Category
- Is there a way to list posts of only a certain category
- Taxonomy structure of Sport site
- Loop through categories and create tab for each
- automatically save custom post type title as a category
- Categories not working as expected with custom post type
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- Getting all custom posts with a certain category
- get_terms won’t display product_cat or any other custom taxonomies when specified
- How to display the categories of the post? (custom post type)