我在一个叫做Categories.
<?php
/*
Template Name: Categories
*/
get_header(); ?>
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<header class="page-header">
<h1 class="page-title">
Categories
</h1>
</header><!-- .page-header -->
<?php
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$args = array(
\'post_type\' => \'post\',
\'posts_per_page\' => \'4\',
\'paged\' => get_query_var(\'paged\')
);
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php
get_template_part( \'content\', \'categories\' );
?>
<?php endwhile; ?>
<?php wp_pagenavi( array( \'query\' => $the_query ) ); ?>
<?php wp_reset_query(); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
我已将admin中的模板设置为
page-categories但是,当我单击下一页时(链接类似于example.com/categories/page/2/
) 我得到404页。
为什么会这样?如何修复它?