Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 查询\u posts排除目录,下一个\u posts\u链接不工作_Wordpress - Fatal编程技术网

Wordpress 查询\u posts排除目录,下一个\u posts\u链接不工作

Wordpress 查询\u posts排除目录,下一个\u posts\u链接不工作,wordpress,Wordpress,有人能看一下下面的代码吗?在我排除类别15之后,下一个链接不起作用,页面导航插件也不起作用。当我单击第2、3、4页时,它只显示第1页中的帖子 <?php query_posts('cat=-15'); ?> <?php while (have_posts()) : the_post(); ?> ... .... <?php endwhile; else: ?> <?php next_po

有人能看一下下面的代码吗?在我排除类别15之后,下一个链接不起作用,页面导航插件也不起作用。当我单击第2、3、4页时,它只显示第1页中的帖子

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

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

...  ....
那么

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

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

  <?php next_posts_link() ?>        

<?php endif; ?>

...  ....
??试着这样做:

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


这应该行。

温和,对不起,我的错误。下一个链接在endif之前。我更新了代码