Advertisement
Guest User

Untitled

a guest
Sep 7th, 2015
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None
  1. $new_query = new WP_Query();
  2. $new_query->query( 'showposts=5&cat=9&paged='.$paged );
  3. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  4.  
  5. ?>
  6.  
  7. <?php if ( $new_query->have_posts() ) : ?>
  8. <?php /* Start the Loop */ ?>
  9. <?php
  10. while ($new_query->have_posts()) : $new_query->the_post();
  11.  
  12. ...
  13.  
  14. endwhile; ?>
  15.  
  16.  
  17. <div>
  18. <?php
  19. echo paginate_links( array(
  20. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  21. 'format' => '?paged=%#%',
  22. 'current' => max( 1, get_query_var('paged') ),
  23. 'total' => $wp_query->max_num_pages,
  24. 'before_page_number' => '<span class="screen-reader-text">'.$translated.' </span>'
  25. ) );
  26. ?>
  27. </div>
  28.  
  29. <?php endif; ?>
Advertisement
RAW Paste Data Copied
Advertisement