有些Typecho主题中是没有自带面包屑导航的,那我们就需要自己来定义。尤其是在页面比较多的时候需要用到面包屑导航,要不用户访问页面之后无法进入其他页面。在这篇文章中,老蒋整理到Typecho官方提供的面包屑导航方法,这里老蒋也整理出来有需要的时候直接就可以贴出来使用。
> <div class="crumbs_patch">
> <a href="<?php $this->options->siteUrl(); ?>">Home</a> »</li>
> <?php if ($this->is('index')): ?><!-- 页面为首页时 -->
> Latest Post
> <?php elseif ($this->is('post')): ?><!-- 页面为文章单页时 -->
> <?php $this->category(); ?> » <?php $this->title() ?>
> <?php else: ?><!-- 页面为其他页时 -->
> <?php $this->archiveTitle(' » ','',''); ?>
> <?php endif; ?>
> </div>
这里我们在有需要的页面模板中添加这个脚本。同时需要定义crumbs_patch样式调整。