论坛首页 Web前端技术论坛

wordpress 子页面添加关键词和描述,增强SEO优化

浏览 1949 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-10-12  
jquery特效对seo优化了解的不多,只是一些瞎折腾,今天逛落伍,经一seo达人指出,我的所有子页面所有的关键词描述都是一样,这样对百度谷歌搜索引擎抓取不好。

听那哥们一说还真是回事,现在百度收录不给力,如果我修改了的话,岂不是收录杠杠的。http://www.jqueryba.com/576.html

话说wordpress子页面不带seo功能,百度了一些都是插件的,jquery博客对插件不是感兴趣,全权交付插件的话,请求又得多了,降低按前端开发博客速度不说,还为以后维护不方便。那有木有纯代码改改的呢。

互联网什么都有,参考前人的方法改改吧。

1,打开wp-content/themes/主题模板中的header.php文件

2,<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />在这个下面加上下面代码

3,

<?php if (is_home()) { ?>
<meta name=”keywords” content=”网站关键字” />
<meta name=”description” content=”网站描述” />
<link rel=”canonical” href=”<?php echo get_settings(‘home’); ?>” />
<?php } ?>
<?php if ( is_single() ) { ?>
<meta name=”keywords” content=”<?php $key=”keywords”; echo get_post_meta($post->ID, $key, true); ?>” />
<meta name=”description” content=”<?php $key=”description”; echo get_post_meta($post->ID, $key, true); ?>” />
<link rel=”canonical” href=”<?php echo get_permalink($post->ID);?>” />
<?php } ?>

原文地址 jquery特效 http://www.jqueryba.com/576.html
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics