Title: Custom Post Type pagination issues
Last modified: August 20, 2016

---

# Custom Post Type pagination issues

 *  [benjamw](https://wordpress.org/support/users/benjamw/)
 * (@benjamw)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-pagination-issues/)
 * I have a custom post type named “product” that I pull in through a page called“
   products”. I have pagination links on that page via the wp_pagenavi plugin, and
   when I click the next page link, my URL looks like this “…/products/page/2/” 
   which seems correct, but the page looks wrong and WP is trying to pull posts 
   with the following query:
 * SELECT ID FROM wp_posts WHERE post_name LIKE ‘page%’ AND post_type = ‘product’
   AND post_status = ‘publish’
 * With the output of “Sorry, no posts matched your criteria.” through the index.
   php template instead of the template that is being run via the “products” page.
 * Any suggestions on how to get WP to recognize the “products” page and the “page”
   query var with this URL?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [jkovis](https://wordpress.org/support/users/jkovis/)
 * (@jkovis)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-pagination-issues/#post-2750131)
 * Can you post your call to register_post_type to pastebin.com?
 *  Thread Starter [benjamw](https://wordpress.org/support/users/benjamw/)
 * (@benjamw)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-pagination-issues/#post-2750134)
 * The arguments for the CPT (the second argument of the register_post_type function)
   are given here: [http://pastebin.com/aBwZNBj4](http://pastebin.com/aBwZNBj4)
 * I’ve been playing around with it, and I added a custom rewrite rule, and it seems
   to be finding the page properly, but is still choking on the paged param.
 * Here is my rewrite rule:
    `add_rewrite_rule('products/page/?([0-9]{1,})/?$', '
   index.php?pagename=products&paged=$1', 'top');`
 *  [Denis Leblanc](https://wordpress.org/support/users/snapsize/)
 * (@snapsize)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-pagination-issues/#post-2750142)
 * See if this post helps: [http://wordpress.org/support/topic/pagination-with-custom-post-type-listing?replies=45](http://wordpress.org/support/topic/pagination-with-custom-post-type-listing?replies=45)
 *  [jkovis](https://wordpress.org/support/users/jkovis/)
 * (@jkovis)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-pagination-issues/#post-2750146)
 * Any particular reason you’re not using the ‘has_archive’ argument instead of 
   trying to display products through a separate page?
 * Also just noticed that your CPT rewrite slug is the same as the page name…perhaps
   change it to just product?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom Post Type pagination issues’ is closed to new replies.

## Tags

 * [pagination](https://wordpress.org/support/topic-tag/pagination/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [jkovis](https://wordpress.org/support/users/jkovis/)
 * Last activity: [13 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-pagination-issues/#post-2750146)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
