神奇的IS语法 - 判断该页面是哪个页面
更新:2022-05-26 访问:318
typecho可以使用is语法判断很多东西,比如
$this->is('index');
$this->is('archive');
$this->is('single');
$this->is('page');
$this->is('post');
$this->is('category');
$this->is('tag');
又或者
$this->is('category', 'default');
$this->is('page', 'start');
$this->is('post', 1);
需要注意的是,后面的参数是分类、页面的缩略名 写法
例如判断是否为内容页面
<?php if ($this->is('post')) : ?>
这里就是内容了
<?php endif; ?>