分页赢得';不能在Wordpress中显示

分页赢得';不能在Wordpress中显示,wordpress,pagination,blogs,posts,Wordpress,Pagination,Blogs,Posts,我有这段代码,以每页3条的速度显示博客中的所有帖子(出于特定原因,我不得不使用Wp_查询)。我想不出如何添加分页。以下是我的帖子列表代码: <?php $all_posts = new WP_Query(array( 'posts_per_page' => 3, )); if ($all_posts->have_posts()): while ($all_posts->have_posts()) : $all_posts->the_post(

我有这段代码,以每页3条的速度显示博客中的所有帖子(出于特定原因,我不得不使用Wp_查询)。我想不出如何添加分页。以下是我的帖子列表代码:

<?php

  $all_posts = new WP_Query(array(
    'posts_per_page' => 3,
  ));

  if ($all_posts->have_posts()): while ($all_posts->have_posts()) : $all_posts->the_post();

  ?>

    <div class="row leftNestedRow whiteWrapper boxyShadow">

      <div class="large-12 columns">

        <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

        <?php if ( has_post_thumbnail() ) {
          the_post_thumbnail();
        }?>

        <p class="authorDate">Av <a>Fryk</a>, <?php the_time('Y-m-d'); ?></p>
        <p><span class="homepageBlogExerpt"><?php echo get_the_excerpt(); ?></span><a href="<?php the_permalink() ?>">[Läs mer]</a></p>
        <ul class="tags">
          <?php
            $links = array();
            foreach(get_the_tags() as $this_tag) {
              if ($this_tag->name != "featured"){
               $links[] = '<li><a href="'.get_tag_link($this_tag->term_id).'">'.$this_tag->name.'</a></li>';
              }
            }
            $ai = 0;
            while ($links[$ai]) {
              echo $links[$ai];
              $ai++;
            }
          ?>
        </ul>

      </div>

    </div>

  <?php endwhile; ?>

Av


这已经被问了N次了。你能给我指一个吗,我什么都找不到!