文章标签 ‘优化’
1、更改标题:页面的标题不要包含博客名称 一些包含大量内容的, 或者属于某一类的页面, 只显示标题. 其他的页面只显示博客名称. 我的实现代码如下. <title><?php if ( is_single() || is_page() || is_category() || is_tag() ) { wp_title(”); } else { bloginfo(‘name’); } ?></title> 2、Keywords & Description Keywords 为搜索引擎提供网页包含的核心内容, Description 则为搜索引擎提供网页的描述信息.这个我没有使用一些SEO的插件,自己手动来改代码吧!当然,不同的页面处理方法也不同的。下面是搜索来的: <?php if (is_home()){ $keywords = “wordpress,网络管理,php学习,”; $description = “华斐的学习博客,关注wordpress和互联网相关的一些东西”; } elseif (is_single()){ if ($post->post_excerpt) { $description = $post->post_excerpt; } else { if(preg_match(‘/<p>(.*)<\/p>/iU’,trim(strip_tags($post->post_content,”<p>”)),$result)){ $post_content [...]
分类: 玩转Wordpress
