页面类型太少 至少应该有
index
post
page
category
archive
search
404
方便在header.php 里面用is函数判断来输出不同的标题
archive 里的is函数写的太乱了,一点可读性都没有
Re: archive 里的is函数写的太乱了,一点可读性都没有
代码: 全选
<?php if($this->is('search')): ?>
<div class="boxcaption"><h3><?php _e('Search Results'); ?></h3></div>
<div class="box"><?php _e('Keyword: ‘'); $this->archiveTitle('','',''); _e('’'); ?></div>
<?php else : ?>
<div class="boxcaption"><h3><?php _e('Archive'); ?></h3></div>
<div class="box">
<?php
// If this is a category archive
if ($this->is('category')) {
_e('Archive for the ‘'); $this->archiveTitle('','',''); _e('’ Category');
// If this is a tag archive
} elseif ($this->is('tag')) {
_e('Posts Tagged ‘'); $this->archiveTitle('','',''); _e('’');
// If this is a daily archive
} elseif ($this->is('date')) {
_e('Archive for'); $this->archiveTitle('-',' ','');
// If this is an author archive
} elseif ($this->is('author')) {
_e('Author Archive');
}
?>
</div>
<?php endif; ?
Re: archive 里的is函数写的太乱了,一点可读性都没有
你说的这些判断都支持,请试一下
至于实现方法就不具体解释了
至于实现方法就不具体解释了
Re: archive 里的is函数写的太乱了,一点可读性都没有
都支持的,官方博客里有一篇专门说明的文章你找下