我用的是typecho的默认模板。
将原来的header.php中
<title><?php $this->options->title(); ?><?php $this->archiveTitle(); ?></title>
替换为
<title><?php if ($this->is('index')){
$this->options->title();
}else{
$this->archiveTitle('','','|');
$this->options->title();
}
?>
</title>
具体效果可以看看这个 www.jingang.org
刚刚修改了下title的书写方式 应该对SEO有利吧。。。。代码如下
版主: le720
Re: 刚刚修改了下title的书写方式 应该对SEO有利吧。。。。代码如下
<?php if($this->is('index')): ?><?php $this->options->title(); ?><?php endif; ?>
<?php if($this->is('page')): ?><?php $this->options->title(); ?><?php $this->archiveTitle('','_',''); ?><?php endif; ?>
<?php if($this->is('post')): ?><?php $this->archiveTitle('','','_'); ?><?php $this->keywords('_'); ?>_<?php $this->options->title(); ?><?php endif; ?>
<?php if($this->is('archive')): ?><?php $this->options->title(); ?><?php $this->archiveTitle('_','_',''); ?><?php endif; ?>
<?php if($this->is('page')): ?><?php $this->options->title(); ?><?php $this->archiveTitle('','_',''); ?><?php endif; ?>
<?php if($this->is('post')): ?><?php $this->archiveTitle('','','_'); ?><?php $this->keywords('_'); ?>_<?php $this->options->title(); ?><?php endif; ?>
<?php if($this->is('archive')): ?><?php $this->options->title(); ?><?php $this->archiveTitle('_','_',''); ?><?php endif; ?>