我发现this article 并让它发挥作用
<div class="posts">
<?php
$paged = ( get_query_var( \'paged\' ) ) ? get_query_var( \'paged\' ) : 1;
$the_query = new WP_Query( \'cat=16&paged=\' . $paged );
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<?php get_template_part( \'partials/loop\', \'archive\' ); ?>
<?php endwhile; ?>
</div><!-- /posts -->
</div><!-- /row -->
</div>
<!-- /large-10 -->
<div class="large-2 show-for-large-up columns"></div>
<div class="large-10 medium-12 small-12 columns">
<?php
next_posts_link( \'Older Entries\', $the_query->max_num_pages );
previous_posts_link( \'Newer Entries\' );
?>
</div><!-- /10 columns -->
<?php
wp_reset_postdata();
?>
<?php else: ?>
<p><?php _e( \'Sorry, no posts matched your criteria.\' ); ?></p>
<?php endif; ?>
<!-- /row -->
</section>
<!-- end Posts Section -->
上述方法可行,但如果我在页面navi插件的链接中出现,如:
<?php wp_pagenavi(); ?>
那么,如果我输入到上一页导航代码的链接,我会得到什么?
<?php if (function_exists(\'joints_page_navi\')) { ?>
<?php joints_page_navi(); ?>
<?php } else { ?>
<nav class="wp-prev-next">
<ul class="clearfix">
<li class="prev-link"><?php next_posts_link(__(\'« Older Entries\', "jointstheme")) ?></li>
<li class="next-link"><?php previous_posts_link(__(\'Newer Entries »\', "jointstheme")) ?></li>
</ul>
</nav>
<?php } ?>