增加目录导航,即面包屑导航,如:首页-分类-文章……….代码如下:

<h2>
<strong>当前位置:</strong>
<a href=”<?php get_option(‘home’) ?>” >盒子ui首页</a>
<?php foreach((get_the_category()) as $category) { ?>
<?php
$category_link = get_category_link( $category->cat_ID);
$category_name= $category->cat_name;
?>
> <a href=”<?php echo $category_link ?>” ><?php echo $category_name ?></a>
<?php } ?>
</h2>

做人要厚道,转载请注明文章来源: https://www.boxui.com/blog-history/189.html