C
C
CrewCut2016-02-26 17:07:41
WordPress
CrewCut, 2016-02-26 17:07:41

How to add pagination before posts_per_page loop in wordpress?

News is displayed on the site using a cycle with settings, including the number of pages to display (posts_per_page).

$wp_query = new WP_Query();
$wp_query->query($args);
  
while ( have_posts() ) : the_post();
  get_template_part( 'content', 'newsmini' );
endwhile;

There is a pagination function before and after the cycle. After it, it works fine, and before it, the number of pages takes the standard one from the WordPress settings. How to make pagination before the loop, taking into account posts_per_page ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question