Typecho神奇的is语法
in Typecho with 0 comment
Typecho神奇的is语法
in Typecho with 0 comment

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; ?>

Warning: Undefined array key "permalink" in /www/wwwroot/rinvay.cc/usr/themes/Rinvay/functions.php on line 286

Warning: Undefined array key "permalink" in /www/wwwroot/rinvay.cc/usr/themes/Rinvay/functions.php on line 306
评论
OωO