Title: Pagination does not work
Last modified: August 20, 2016

---

# Pagination does not work

 *  [Rohin](https://wordpress.org/support/users/rohin/)
 * (@rohin)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/pagination-does-not-work-1/)
 * I am unable to get my pagination to work. I am using custom post type and the
   default permalink settings. The Older posts link is also generated however when
   I try to go to the older post link I get a 404 No Content found. Please help.
 *     ```
       <?php get_header();
       ?>
       <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;?>
       <?php
       $args=array( 'post_parent' => 0,'posts_per_page' => 10, 'post_type' => array('post', 'poetry', 'prose', 'book','project','art' ), 'paged' => $paged );
       $wp_query=new WP_query($args);
       ?>
       <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
       <?php get_template_part('content', get_post_type());?>
       <?php endwhile;?>
       if ( $wp_query->max_num_pages > 1 ) :?>
       <nav id="<?php	echo $nav_id;?>">
       	<h3 class="assistive-text"><?php _e('Post navigation', 'signature');?></h3>
       		<?php next_posts_link(__('<span class="meta-nav nav-previous">&larr;</span> Older posts', 'signature'));?>
       		<?php previous_posts_link(__('Newer posts <span class="meta-nav nav-next">&rarr;</span>', 'signature'));?>
       	<div class="clear"></div>
       </nav><!-- #nav-above -->
       <?php get_footer()?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/pagination-does-not-work-1/#post-2921534)
 * It may help to diagnose the problem if you post a link to your site.
 * Just a guess, but try changing $wp_query to $my_query ($wp_query is a special
   variable).
 * If that does not work, print out $paged to be sure it is getting set correctly:
 *     ```
       <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;?>
       <?php print_r("<p>PAGED:$paged</p>"); ?>
       <?php
       ```
   
 * If $paged is not set correctly, try using ‘page’ instead of ‘paged’ for the query_var.

Viewing 1 replies (of 1 total)

 The topic ‘Pagination does not work’ 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/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/pagination-does-not-work-1/#post-2921534)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
