我有一个基于此的自定义主题http://underscores.me/.我有一个名为event bucket的自定义分类法和一个名为bucket的自定义post\\u类型。我有一个页面,可以看到一个事件bucket的所有bucket:
mybesite.com/bucket/my-event-bucket/
此页面运行良好,我使用
the_posts_navigation()
用于导航,当我单击它时,它会重定向到
mybesite.com/bucket/my-event-bucket/page/2
这是404页。但是当我手动输入一个url时
mybesite.com/bucket/my-event-bucket?page=2
它来到了正确的一页。
你知道如何修复“旧帖子”按钮的正常工作吗?
这是我的档案。php mybesite调用的模板。com/bucket/我的事件bucket/
<?php
/**
* The template for displaying archive pages.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package socialite
*/
get_header(\'bucket\'); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( \'<h1 class="page-title">\', \'</h1>\' );
the_archive_description( \'<div class="archive-description">\', \'</div>\' );
?>
</header><!-- .page-header -->
<?php
$paged = (get_query_var(\'page\')) ? get_query_var(\'page\') : 1;
query_posts( array( \'post_type\' => \'bucket\', \'paged\' => $paged ) );
/* Start the Loop */
while ( have_posts() ) : the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( \'template-parts/content\', get_post_format() );
endwhile;
the_posts_navigation();
else :
get_template_part( \'template-parts/content\', \'none\' );
endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
// get_sidebar();
get_footer();