dontfear

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

4 posts in this topic

Всего 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(); ?>	

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

Share this post


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);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.