归档页面, 分类页面, 也就是 archive.php
这里提供一个参考, 做面包屑导航, 输出分类, 以及列出文章
把如下代码粘贴到你新建主体的 archive.php 中即可
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
*/
// 页面头部
get_header(); ?>
<main class="site-main" role="main">
<!--面包屑导航-->
<p style="font-size:16px;margin:0px;padding:0px;">
当前位置: <?php echo '<a href='.get_bloginfo('url').'>'.get_bloginfo('name').'</a>',">>",single_cat_title(); ?>
</p>
<!--分类与描述-->
<h1 style="margin:0px;color:rgb(230,230,0);"><?php $thiscat = get_category($cat); echo"分类:",$thiscat ->name;?></h1>
<h2 style="margin:0px;color:rgb(205,205,0);text-indent:2rem;"><?php echo $thiscat ->description;?></h2>
<!-- 文章展示 -->
<ol>
<?php query_posts("order=asc&showposts=-1&cat= $cat"); ?>
<!-- //query_posts 给 The Loop 限定的条件是:显示所有日志和分类文章 -->
<?php while (have_posts()) : the_post(); ?>
<!--//The Loop 开始 -->
<li style="margin:5px;font-size:24px;">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><? echo get_the_title(); ?></a>
</li>
<!-- //用列表的方式输出带有链接的文章标题-->
<?php endwhile;wp_reset_query(); ?>
<!--//The Loop 结束 -->
</ol>
<!-- /文章展示 -->
</main><!-- .site-main -->
<!-- /边栏和页脚 -->
<?php
get_sidebar();
get_footer();
?>