If this is the main loop you use to display posts on your page, you should not execute a new loop but modify the existing loop that WordPress will execute anyway. This way you can be sure that all extra query parameters will be taken into account.
Here we want to display posts of type game
and limit the number of posts on the page. You can do this with the following code:
add_action( 'pre_get_posts', 'wpse5477_pre_get_posts' );
function wpse5477_pre_get_posts( &$wp_query )
{
if ( $wp_query->is_category() ) {
$wp_query->set( 'post_type', 'game' );
$wp_query->set( 'posts_per_page', 2 );
}
}
Related Posts:
- Display “Post 2 of 4” on single post page?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Page vs Custom Post Types Differences/Issues
- How to display data with pagaination on backend?
- Pagination not working with custom loop
- WP_Query Pagination on single-custom.php
- Have different number of posts on first page
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- wp_pagenavi() with custom wp_query()?
- Custom Post Type as Page parent
- How to add a post from a custom post type as the static page?
- Custom permalink with pagination
- Custom Posts on Different Pages
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- Custom post type archive with pagination?
- Include images from pages in wp search.php results in default wp search
- Pagination on a custom page template
- Pagination problems with multiple custom post type archive pages
- posts_nav_link on single post template
- Pagination problem in custom post type used as front page
- Custom Taxonomy archive returns 404
- Pagination with custom post types results in 404 issues
- Custom query form submission pagination
- Paginated Taxonomy Term Archive including one post per term
- Pagination links not showing on custom post type admin list
- Pagination on Custom Post Type: 404 Error
- Pagination in a Shortcode. Get_next_posts_link not working but get_previous_posts_link works fine right next to it
- Is it possible to use pages to apply static content to each taxonomy level?
- ‘Pages’ widget alternative for custom post types?
- Custom Blog Post Listing in Genesis Sample Child Theme
- How to load custom post archives sub-pages with ajax?
- Pull in custom content types into page template
- Pagination on category page with custom post types
- Archive template for custom post type only lists first 10
- Disable featured image
- Pagination is not working in custom post type
- Custom post type not displaying all entries
- Custom post type (with parent-child relationship) singular page with pagination
- How do I move/order posts with a tag to the end?
- Add Pagination on Custom Post Type Archive
- Woocommerce search pagination not working
- No Permission to add new Page, Post or CPT with Admin role
- How To Show All Custom Post Types In A Category Instead Of Pagination?
- Custom Post Type Pagination Paginates Only in URL Structure
- Show Custom Post Type meta boxes only on Page Edit
- Why does my content disapear when I make a page to match an archive name?
- Pros and cons of a custom page vs custom post type template file
- Pagination broken by naming conflict between CPT and Page
- How to include custom post type posts on a page?
- Pagination Error : Duplicate argument being outputted
- Can I change my post type to anything and my site still work?
- Page listing Custom Posts
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Why are some of my custom posts not showing up on my page?
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Pagination hitting 404 page on /page/4
- Using Pagination for Custom Post Type and keeps returning 404
- Pagination for search results of custom post type [duplicate]
- All blog posts are not showing up
- wp_dropdown_pages with tax_query clause
- Am I mixing up the concept of posts pages and categories?
- Tag template not returning posts [closed]
- Custom Post Type, Pagination and 404s?
- 2 custom post type paging in 1 custom taxonomy
- How to set a ‘page’ as parent of a custom post type?
- Sticky posts limit query and pagination for a custom post type
- Pagination in custom post type archive.php not working
- Custom Post Type Pagination getting 404 error
- Metabox collapsed by default
- Numeric pagination custom post type
- Problems in paginate_links with custom query loop and MB-Relationships
- How to make “single post” permalink maintain it’s sub-page structure
- User Archive page for Custom Post Type – Pagination Issue
- Custom post pagination not working
- CPT/Taxonomy/Postname permalink structure makes pagination break
- How to get a custom post type archive paged when using a custom field for post sorting?
- Pagination in wp-admin for CPT
- Include images from pages in wp search.php results in default wp search
- Add pagination to custom page
- WordPress Contents Migration
- Pods pagination erases my sub menu
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Use the page picker from wordpress menu creation page
- Custom post type archive pagination with HTML5Blank theme?
- archive.php can’t find categorized posts
- Paginate custom taxonomy category with wp_custom_pagination
- Custom post type navigation on static page
- Custom pagination [duplicate]
- Rewrite Rule & Regex – Extract ‘cat-name’ and ‘page-number’ from http://domain.com/custom-post-type/category/cat-name/page/page-number
- Using pagination with specific custom post type [duplicate]
- Pagination not working with custom loop
- Pagination not working with custom loop
- Pagination not working with custom loop
- Page that ‘subscribes’ to multiple categories
- send user to first page of results when reposting to page?
- Fourth page of custom post type archive page does not exist
- Pagination broke after updateto WordPress 3.4 [duplicate]
- How do I hide single category post on my post page
- Unable to display paging navigation with a custom post type loop
- WPNavi pagination links not working on custom pages