admin管理员组文章数量:1287828
i make it a custom page blog with 4 post per page but when i want to change the page, i get same posts from the first page. This is how is look my code `
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'posts_per_page' =>4, 'post_type' => 'post' , 'order'=> 'DESC', 'orderby' => 'post_date', 'paged' => $paged,'post_status' => 'publish');
$postslist = new WP_Query( $args );
?>
<div class="container-of-dp">
<?php
if ( $postslist->have_posts() ) :
while ( $postslist->have_posts() ) : $postslist->the_post(); ?>
<div class="article-div">
<img src="<?php echo get_the_post_thumbnail_url();?>"/>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a><br />
<small><?php the_time('F jS, Y') ?> by <?php the_author(); ?></small>
<?php the_excerpt(); ?><br />
</div>
<?php endwhile; ?>
</div>
<div class="navigation-blog">
<div class="alignright"><?php previous_posts_link( '« Previous ' ); ?></div>
<div class="alignleft"><?php next_posts_link( 'Next »', $postslist->max_num_pages ); ?></div>
</div>
</div>
<?php wp_reset_postdata();
endif;
?>
</div>
本文标签: Pagination not give another posts
版权声明:本文标题:Pagination not give another posts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741284220a2370177.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论