在网站页面中常见的如“首页 » 新闻中心 » 正文”的东西就是面包屑,页面面包屑一般用来展现当前页面在网站中的位置,以及对网站的SEO优化起到促进作用,特别是网页构造条理较深的网站,因而面包屑几乎是网站必备的模块。那末typecho的面包屑要怎样完成?下面是详细的typecho面包屑代码。
面包屑代码:
123456789 | <div class="breadcrumb"> <?php if($this->is('index')):?><!-- 页面首页时 --><a href="<?php $this->options->siteUrl(); ?>" title="<?php $this->options->title(); ?>">首页</a> ><?php elseif ($this->is('post')): ?><!-- 页面为文章单页时 --><a href="<?php $this->options->siteUrl(); ?>" title="<?php $this->options->title(); ?>">首页</a> > <?php $this->category(); ?> > <?php $this->title(); ?><?php else: ?><!-- 页面为其他页时 --><a href="<?php $this->options->siteUrl(); ?>" title="<?php $this->options->title(); ?>">首页</a> > <?php $this->archiveTitle(' » ','',''); ?><?php endif; ?></div> |
把上面的代码添加到要显现面包屑位置对应的模板文件中,如header.php。

评论列表