Title: Adding Pagination to Custom Post Type
Last modified: August 20, 2016

---

# Adding Pagination to Custom Post Type

 *  [occams_laser](https://wordpress.org/support/users/occams_laser/)
 * (@occams_laser)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/)
 * I am currently trying to add pagination ex.(Prev,1,2,3,4,5,Next) to a custom 
   post type I created. After troubleshooting for a few hours I cannot figure out
   what is going on. Any help would be much appreciated!
 * [Here](http://pastebin.com/q85pqb20) is a link to pastebin of my loop.

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/#post-2799209)
 * Take a look at the [WP PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/)
   plugin.
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/#post-2799214)
 * Not sure if you are having trouble with paging or you want to know about the 
   plugins?
 * If you are having trouble with paging then try and remove:
 *     ```
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       ```
   
 * _Plugins:_
    If you want page-navi or wp-navigate plugins then [this post](http://digitalraindrops.net/2012/04/twenty-eleven-and-the-pluggable-functions/)
   might help you locate the code.
 * HTH
 * David
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/#post-2799215)
 * [@david](https://wordpress.org/support/users/david/), look at the pastebin – 
   $paged is set and in the query parameters.
 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/#post-2799223)
 * Hi vtxzzy,
    I would **remove the line**, it is not needed, as `'paged' => $paged,`
   tells WordPress to return the $paged variable, so as you navigate through the
   pages WordPress sets the value, I never use the line and it works ‘out the box’
   for my queries.
 * If we look at the [Codex](http://codex.wordpress.org/Class_Reference/WP_Query#Parameters)
 * > Pagination Note: You should set _**get\_query\_var( ‘page’ );**_ if you want
   > your query to work with pagination. Since WordPress 3.0.2, you do get_query_var(‘
   > page’ ) **instead** of get_query_var( ‘paged’ ). The pagination parameter ‘
   > paged’ for WP_Query() remains the same.
 * I just use:
 *     ```
       'paged'=> $paged,
       ```
   
 * Which is like:
 *     ```
       'paged'=> get_query_var( 'page' ),
       ```
   
 * Regards
 * David
 *  Thread Starter [occams_laser](https://wordpress.org/support/users/occams_laser/)
 * (@occams_laser)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/#post-2799234)
 * Hey guys,
 * Thanks for the responses! I managed to fix my problem by using the WP PageNavi
   plugin. I thought WordPress had default paging features in the core files.
 * I have another question for you guys, how would I go about having a “View All”
   link next to the pagination which would display all related posts on the page?
   Thanks again for the responses!

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

The topic ‘Adding Pagination to Custom Post Type’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [occams_laser](https://wordpress.org/support/users/occams_laser/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/adding-pagination-to-custom-post-type/#post-2799234)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
