Title: Implementing pagination
Last modified: August 20, 2016

---

# Implementing pagination

 *  [giberisk](https://wordpress.org/support/users/giberisk/)
 * (@giberisk)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/implementing-pagination/)
 * Hi
    I used CCTM to create a new post type, but I am having problems with pagination.
   Here is my code :
 *     ```
       <?php
           //Fix homepage pagination
           if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } else if ( get_query_var('page') ) {$paged = get_query_var('page'); } else {$paged = 1; }
   
           $temp = $wp_query;  // re-sets query
           $wp_query = null;   // re-sets query
           $args = array('post_type' => 'Track', 'orderby'=>'date', 'order'=>'DESC', 'posts_per_page' => 1, 'paged' => $paged);
           $wp_query = new WP_Query();
           $wp_query->query( $args );
           while ($wp_query->have_posts()) : $wp_query->the_post();
       ?>
   
       <div class="post-inner pad-10"><div class="zChenarPost">
       <div class="zPinkTop">
       <div class="zArtistTop"><?php $my_array = get_custom_field('trackArtist:to_array');$artistString = implode(" , ", $my_array);print $artistString?></div>
       <div class="zTrackNameTop"><?php print_custom_field('trackName'); ?></div>
                       </div>
       <div class="zPostSpacer"></div>
       <div class="zTrackInfoTags"><?php print_custom_field('trackReleaseDate'); ?></div>
       <div class="zTrackInfoTags"><?php print_custom_field('trackLabel'); ?></div>
       <div class="zTrackInfoTags"><?php print_custom_field('trackCountry'); ?></div>
       <div class="zTrackInfoTags"><?php print_custom_field('trackBPM'); ?> BPM</div>
       <div class="zTrackInfoTags"><?php print_custom_field('trackLength'); ?></div>
       <div class="zTrackInfoTags"><?php $my_array = get_custom_field('trackGenre:to_array');foreach ($my_array as $item) { print $item; }?></div>
       <div class="zPostSpacer"></div>
       <?php $trackLinkX = get_custom_field('trackLink'); ?>
       <?php $trackImageX = get_custom_field('trackAvatar'); ?>
   
       <?php echo '<img class="zPlayerImage" src="'.$trackImageX.'">';?>
       <?php echo '<div link="'.$trackLinkX.'" class="zPlayerContainer" id="player'.get_the_id().'">'; ?>
   
               <div class="zPlayerSeek">
               <div class="zPlayerSeekBar"></div>
               </div>
               <div class="zPlayerStartTime">00:00</div>
               <div class="zPlayerEndTime">00:00</div>
               <img class="zPlayerPlayBtn" src="img/playBtn.png"></img>
               <img class="zPlayerPauseBtn" src="img/pauseBtn.png"></img>
       </div>
       </div>
       </div>
       <?php	 endwhile;?>
   
       <?php if(function_exists('wp_paginate')) {
           wp_paginate();
       } ?>
       ```
   
 * However when I click on the generated links, it gives me a 404.
 * My website is publicjams.com, you can see for yourself.
    For some reason if I
   go directly to publicjams.com?page=2, it works..
 * [http://wordpress.org/extend/plugins/custom-content-type-manager/](http://wordpress.org/extend/plugins/custom-content-type-manager/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/implementing-pagination/#post-3622769)
 * Sounds like an issue with your .htaccess or permalink settings.
 * Posting your link like that is generally not useful, by the way. There’s no guarantee
   that what a reader is looking at is what you were looking at when you posted 
   the link.

Viewing 1 replies (of 1 total)

The topic ‘Implementing pagination’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/implementing-pagination/#post-3622769)
 * Status: not resolved