Advertisement
hmbashar

Custom Post Query with pagination in wordpress

Jan 17th, 2016
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. /*
  2. www.wp-tutorials.com
  3. */
  4. <?php
  5.   $temp = $wp_query;
  6.   $wp_query = null;
  7.   $wp_query = new WP_Query();
  8.   $wp_query->query('showposts=-1&post_type=doctor-items'.'&paged='.$paged);
  9.  
  10.   while ($wp_query->have_posts()) : $wp_query->the_post();
  11. ?>
  12.  
  13.                            
  14. <!-- content -->
  15.  
  16. <!-- Content -->
  17.  
  18.  
  19. <?php endwhile; ?>
  20.  
  21. <div class="blog_post_pagi"><?php the_posts_pagination();?> </div>
  22.  
  23. <?php
  24.   $wp_query = null;
  25.   $wp_query = $temp;  // Reset
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement