Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php // the query to set the posts per page to 3
  2. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  3. $args = array(
  4. 'posts_per_page' => 3,
  5. 'paged' => $paged ,
  6. 'order' => 'ASC',
  7. );
  8. $custom_query = new WP_Query( $args ) ?>
  9. <!-- the loop -->
  10. <?php if ( $custom_query->have_posts() ) : while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
  11. //Content
  12. <?php endwhile; ?>
  13. <!-- pagination -->
  14. <div>
  15. <?php if (function_exists("pagination")) {
  16. pagination($custom_query->max_num_pages);
  17. } ?>
  18. </div>
  19. <?php else : ?>
  20.  
  21. <?php endif; ?>
  22. <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement