这是我的存档模板。php模板:
<?php /* Template Name: Archives */ ?>
<?php include \'head.php\' ?>
<body>
<?php include \'header-page.php\' ?>
<main class="main_index">
<section class="posts">
<div class="center">
<div>
<h2>
<?php single_cat_title(); ?>
</h2>
</div>
<div>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<a href="<?php the_permalink(); ?>">
<h3>
<?php the_title(); ?>
</h3>
</a>
<a href="<?php the_permalink(); ?>">
<div class="post_thumbnail">
<?php the_post_thumbnail( \'post_cover\' ); ?>
</div>
</a>
<div>
<span><?php echo get_the_date(); ?></span>
<span><?php echo the_category(\', \'); ?></span>
<span>
<?php
echo get_the_tag_list(\'<p>\',\', \',\'</p>\');
?>
</span>
</div>
</div>
<?php endwhile ?>
<nav class="pagination">
<?php
echo paginate_links( array(
\'total\' => $wp_query->max_num_pages,
\'prev_text\' => __(\' « \'),
\'next_text\' => __(\' » \'),
) );
?>
</nav>
<?php else : ?>
<p>Nic tu nie ma:(</p>
<?php endif; ?>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>
它适用于ech类别、标记和自定义帖子分类以及自定义帖子存档,但不适用于默认帖子存档。当我想在菜单中添加“所有帖子”时,我没有像CPT中那样的“全部”选项。我错过了什么?