<title><?php echo $this->page_title; ?></title>替换成
<?php if (!$this->user_id) { ?> <?php if (!$_GET['app'] OR $_GET['app'] == 'home') { ?> <title><?php echo $this->page_title; ?>-SEO关键词往这里填!</title> <?php } else { ?> <title><?php echo $this->page_title; ?></title> <?php } ?> <?php } else { ?> <title><?php echo $this->page_title; ?></title> <?php } ?>这个SEO是给搜索引擎看的,所以做了没有登陆的判断。 我不懂PHP,不知道代码可不可以再优化。 希望官方以后可以在后台设置SEO标题。
AI智能回复搜索中,请稍后...
5 回答
post_excerpt) { $description = $post->post_excerpt; } else { $str = csubstr(strip_tags($post->post_content),0,220); $str = trim($str); $str = strip_tags($str,""); $str = ereg_replace("\t","",$str); $str = ereg_replace("\r\n","",$str); $str = ereg_replace("\r","",$str); $str = ereg_replace("\n","",$str); $str = ereg_replace(" "," ",$str); $description = trim($str); } $keywords = ""; $tags = wp_get_post_tags($post->ID); foreach ($tags as $tag ) { $keywords = $keywords . $tag->name . ", "; } } ?>= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s' ), max( $paged, $page ) ); ?>