开发者

query_posts Exclude Directory, next_posts_link not work

Can anybody look at the following codes? After I excluded the category 15, the next_posts_link does not work, nor does the page navigation plugin. When I click the page 2, 3,4, it only display the posts in page 1.

<?php query_posts('cat=-15'); ?>

   开发者_JS百科 <?php while (have_posts()) : the_post(); ?>
           ...  ....
         <?php endwhile; else: ?>
        <?php next_posts_link() ?>
    <?php endif; ?>


How about...

<?php query_posts('cat=-15'); ?>

    <?php while (have_posts()) : the_post(); ?>
           ...  ....
    <?php endwhile; ?>

  <?php next_posts_link() ?>        

<?php endif; ?>

??


Try it like this:

<?php query_posts(array( 'cat' => -15, 'paged' => get_query_var('paged') ) ); ?>

This should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜