我们有时候在设计 typcho程序的显示内容,需要在指定必须在首页显示,这里我们可以用这个判断逻辑。

<?php if($this->is('index')): ?>
//首页输出内容
<?php else: ?>
//不是首页输出内容
<?php endif; ?>