Jump to content

Вывод списка страниц WP_Query


Recommended Posts

Всего 160 постов, выводятся по 20 с помощью WP_Query

<? $args = array( 'posts_per_page' => 20, 'cat' => 5,);?>	
<? $query = new WP_Query( $args );?>	
<? while ( $query->have_posts() ) {?>					
<? $query->the_post();?>	
<div><?php the_time('d.m.Y'); ?>
	<a href="<?php the_permalink(); ?>"><? the_title(); ?></a> 					
</div>
<? }?>
					
<? wp_reset_postdata(); ?>	

Как вывести пагинацию?

Link to post
Share on other sites

Всего 160 постов, выводятся по 20 с помощью WP_Query

<? $args = array( 'posts_per_page' => 20, 'cat' => 5,);?>	
<? $query = new WP_Query( $args );?>	
<? while ( $query->have_posts() ) {?>					
<? $query->the_post();?>	
<div><?php the_time('d.m.Y'); ?>
	<a href="<?php the_permalink(); ?>"><? the_title(); ?></a> 					
</div>
<? }?>
					
<? wp_reset_postdata(); ?>	

Как вывести пагинацию?

 

как то ручками

array( 'posts_per_page' => 20, 'cat' => 5, 'paged' => 2);
Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...