• I create custom post type and display in front end successfully but I have a problem in “pagination”.
    Below is my archive-dp_work.php code,

    <?php
    $temp = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query('showposts=1&post_type=dp_work'.'&paged='.$paged);
    if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
     <div class="dp-devblogc">
              <div class="col-md-6 work_list_left">
                                          <h2><a>"><?php the_title(); ?></a></h2>
                                          <div class="dp-blogtbg"> 
    
                                          </div>
                                          <?php the_excerpt(); ?>
                                          <a>" title="Read More"> Read More  <span></span><i class="fa fa-caret-right"></i></a>
                                          </div>
                  <div class="col-md-6 work_list_right">
              <?php the_post_thumbnail('post-thumbnail', array( 'class' => "img-responsive")); ?>
                  </div>
                                       </div>
    <?php endwhile; ?>
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('? Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries ?') ?></div>
    </div>
    <?php $wp_query = null;
    $wp_query = $temp;
    ?>
    <?php else : ?>
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <?php endif; ?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Post Type Pagination’ is closed to new replies.