最近用wellcms做一个词典的应用,标题seo需要优化一下,记录几个修改点:
1、修改模板文件read.html 根据fid显示格式化标题
<?php if( $fid>1 && $fid<28 ){ echo $thread['subject'].'的中文翻译'.$thread['subject'].'的中文意思';} else if( $fid>27 && $fid<55 ) { echo '用'.$thread['subject'].'造句,'.$thread['subject'].'例句'; } else { echo $thread['subject'];} ?>
2、route/read.php文件 根据fid显示格title式化标题
if( $fid>1 && $fid<28 ){ $header['title'] = $thread['subject'].'的中文翻译'; } else if( $fid>27 && $fid<55 ) { $header['title'] = $thread['subject'].'例句'; } else { $header['title'] = $thread['subject']; }
和
if( $fid>1 && $fid<28 ){ $header['description'] = $thread['subject'].'的中文翻译'.$thread['subject'].'什么意思'.$thread['subject'].'发音-用法'; } else if( $fid>27 && $fid<55 ) { $header['description'] = '用'.$thread['subject'].'造句,'.$thread['subject'].'例句,关于'.$thread['subject'].'的句子'; } else { $header['description'] = $thread['description'] ? $thread['description'] : $thread['brief']; }
3、修改模板thread_list.inc.htm文件 55行左右
<?php if( $_thread['fid']>1 && $_thread['fid']<28 ){ echo $_thread['subject'].'的中文翻译';} else if( $_thread['fid']>27 && $_thread['fid']<55 ) { echo '用'.$_thread['subject'].'造句'; } else { echo $_thread['subject'];} ?>
每日壁纸