Advertisement
firoze

pagination for custom post

Jan 2nd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. // pagination for custom post
  2.  
  3. <?php
  4. $temp = $wp_query;
  5. $wp_query = null;
  6. $wp_query = new WP_Query();
  7. $wp_query->query('post_type=carvings' . '&paged=' . $paged . '&posts_per_page=12');
  8. ?>
  9. <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
  10.  
  11. <!-- output -->
  12.  
  13. <?php endwhile; ?>
  14. <?php previous_posts_link(); ?>
  15. <?php next_posts_link(); ?>
  16. <?php $wp_query = null; $wp_query = $temp; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement