向自定义文章存档页面添加文章数量


Adding number of posts to custom post archive page.

我正在使用Wordpress和根模板。我创建了一个档案页面来显示会员档案。-它只是将index.php保存为archive-members.php,这样它就可以获得成员帖子,但我不知道如何更改它显示的数字。我希望它能显示所有内容。它没有使用任何自定义的post-type查询,它只是这个post-type slug 的存档

这是我的页面代码。

    <div class="purple row">
  <div class="container">
    <div class="col-lg-12">
      <?php get_template_part('templates/page', 'header'); ?>
    </div>
  </div>
</div>
<?php if (!have_posts()) : ?>
  <div class="alert alert-warning">
    <?php _e('Sorry, no results were found.', 'roots'); ?>
  </div>
  <?php get_search_form(); ?>
<?php endif; ?>
<div class="row pagecontent">
  <div class="container">
    <?php while (have_posts()) : the_post(); ?>
    <div class="col-sm-3">
      <?php get_template_part('templates/members', get_post_format()); ?>
    </div>
  <?php endwhile; ?>
  <?php if ($wp_query->max_num_pages > 1) : ?>
</div>
</div>
  <div class="container">
    <div class="col-lg-12">
       <nav class="post-nav">
    <ul class="pager">
      <li class="next"><?php next_posts_link(__('Next Page &rarr;', 'roots')); ?></li>
      <li class="previous"><?php previous_posts_link(__('&larr; Previous Page', 'roots')); ?></li>
    </ul>
  </nav>
    </div>
  </div>

<?php endif; ?>

我相信这个问题已经在这里得到了回答。

该线程中的答案链接到使用query_post()函数的WordPress代码。

或者作为其他处于线程状态的人,您可以尝试更改管理界面中的设置(设置->阅读)。在那里,你会看到一个框,允许你更改页面上显示的帖子数量。