queryposts功能在第2页上不起作用

时间:2013-06-18 12:12:43

标签: jquery wordpress post

当你转到http://birdtowncrossfit.com/wod/时,你会发现每日帖子。当您单击底部的先前帖子时,它会转到/ pages / 2,但前10个帖子仍会显示。我希望在第一页上显示10个帖子,在下一页显示前10个帖子,依此类推。

1 个答案:

答案 0 :(得分:0)

<?php
$cat = 1;
$showposts = 5; // -1 shows all posts
$do_not_show_stickies = 1; // 0 to show stickies
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
    'category__in' => $cat,
    'showposts' => $showposts,
    'caller_get_posts' => $do_not_show_stickies,
    'paged' => $paged
   );
$my_query = new WP_Query($args); ?>
<?php query_posts($args); if( have_posts() ) :?>
<?php while ( have_posts() ) : the_post(); ?>

<!-- put title and content tags here -->

<?php endwhile;endif; ?>