typecho页面面包屑导航代码
作者:xlnxin发布时间:2021-04-15分类:Typecho教程浏览:462
导读:在网站页面中常见的如“首页»新闻中心»正文”的东西就是面包屑,页面面包屑通常用来展示当前页面在网站中的位置,以及对网站的SEO优化起到促进作用,特别是网页结构层次...
在网站页面中常见的如“首页 » 新闻中心 » 正文”的东西就是面包屑,页面面包屑通常用来展示当前页面在网站中的位置,以及对网站的SEO优化起到促进作用,特别是网页结构层次较深的网站,因此面包屑几乎是网站必备的模块。那么typecho的面包屑要怎么实现?下面是具体的typecho面包屑代码。
面包屑代码:
1 2 3 4 5 6 7 8 9 | <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。
相关推荐
- 微信小程序反编译报SyntaxError: Unexpected token ‘}‘ 不完美的解决方法
- zblogphp使用GetArticleList、GetList函数调用热门文章列表
- expose_php = On/Off,是干什么的?底层原理是什么?
- Windows10 DVDRW识别为CD驱动解决方法,windows无法读取驱动器E:\中的光盘解决方法
- windows无法读取驱动器中的光盘(windows10)
- WordPress添加彩色标签云
- WordPress添加友情链接页面(自动获取favicon.ico图标)
- WordPress添加相关文章功能(标题/缩略图样式)
- WordPress返回顶部插件:wp-auto-top
- WordPress代码:添加分页导航菜单
- Typecho教程排行
- 最近发表