<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 我是如何 SEO WordPress 的 2：Description 和 Keywords</title>
	<atom:link href="http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/feed/" rel="self" type="application/rss+xml" />
	<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/</link>
	<description>关注 WordPress，关注互联网</description>
	<lastBuildDate>Thu, 24 May 2012 03:36:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: 童佳倩</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-49583</link>
		<dc:creator>童佳倩</dc:creator>
		<pubDate>Tue, 20 Mar 2012 04:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-49583</guid>
		<description>&lt;p&gt;感谢分享，参考了网上很多资料，最终还是会选择你的这种方式，他比较高效率，简单实用，，不过avchive页面我可能要适当加个优化代码。。。&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>感谢分享，参考了网上很多资料，最终还是会选择你的这种方式，他比较高效率，简单实用，，不过avchive页面我可能要适当加个优化代码。。。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-49024</link>
		<dc:creator>Denis</dc:creator>
		<pubDate>Tue, 11 Oct 2011 16:28:49 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-49024</guid>
		<description>debug 下 WP，init 时候会 get_posts。所有就有全局变量 $posts 和 $post！</description>
		<content:encoded><![CDATA[<p>debug 下 WP，init 时候会 get_posts。所有就有全局变量 $posts 和 $post！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yanjie</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-49022</link>
		<dc:creator>yanjie</dc:creator>
		<pubDate>Tue, 11 Oct 2011 14:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-49022</guid>
		<description>$post-&gt;post_excerpt;
显然这段代码是放在the loop之前的，我从网上查到的资料来看，$post标签是在the_post()被调用之后才赋值的，显然，这里把代码放在header.php中，也就肯定是在the loop之外，所以，如果按照“官方”的说法，这样调用$post是没有值的，或者是上一次the_post的错误的值，不是当前页面的值。
而实践得知，$post确实是当前页面的值。这样就和网上的说法矛盾了。
求解释！</description>
		<content:encoded><![CDATA[<p>$post-&gt;post_excerpt;<br />
显然这段代码是放在the loop之前的，我从网上查到的资料来看，$post标签是在the_post()被调用之后才赋值的，显然，这里把代码放在header.php中，也就肯定是在the loop之外，所以，如果按照“官方”的说法，这样调用$post是没有值的，或者是上一次the_post的错误的值，不是当前页面的值。<br />
而实践得知，$post确实是当前页面的值。这样就和网上的说法矛盾了。<br />
求解释！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-49003</link>
		<dc:creator>Denis</dc:creator>
		<pubDate>Sat, 08 Oct 2011 05:54:29 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-49003</guid>
		<description>&lt;meta name=&quot;keywords&quot; content=&quot;” /&gt;
&lt;meta name=&quot;description&quot; content=&quot;” /&gt;

这个放到下面的 判断里面

if(is_home()) &#124;&#124; is_single()){

}</description>
		<content:encoded><![CDATA[<p>&lt;meta name=&#8221;keywords&#8221; content=&#8221;” /&gt;<br />
&lt;meta name=&#8221;description&#8221; content=&#8221;” /&gt;</p>
<p>这个放到下面的 判断里面</p>
<p>if(is_home()) || is_single()){</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leonluo</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-49001</link>
		<dc:creator>leonluo</dc:creator>
		<pubDate>Fri, 07 Oct 2011 19:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-49001</guid>
		<description>已经使用这个方法，主页和文章页都很好，
但请问：如何把page页面的
&lt;meta name=&quot;keywords&quot; content=&quot;&quot; /&gt;
&lt;meta name=&quot;description&quot; content=&quot;&quot; /&gt;
去掉呢？
谢谢了</description>
		<content:encoded><![CDATA[<p>已经使用这个方法，主页和文章页都很好，<br />
但请问：如何把page页面的<br />
&lt;meta name=&quot;keywords&quot; content=&quot;&#8221; /&gt;<br />
&lt;meta name=&quot;description&quot; content=&quot;&#8221; /&gt;<br />
去掉呢？<br />
谢谢了</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: simonds</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-48139</link>
		<dc:creator>simonds</dc:creator>
		<pubDate>Fri, 25 Mar 2011 02:18:20 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-48139</guid>
		<description>第二步照做了。</description>
		<content:encoded><![CDATA[<p>第二步照做了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 鱼逸涵</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-47312</link>
		<dc:creator>鱼逸涵</dc:creator>
		<pubDate>Wed, 01 Dec 2010 14:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-47312</guid>
		<description>哈哈，赶紧用上。 :razz:</description>
		<content:encoded><![CDATA[<p>哈哈，赶紧用上。 <img src='http://fairyfish.b0.upaiyun.com/smilies/icon_razz.gif' alt=':razz:' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oceanthink</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-44940</link>
		<dc:creator>oceanthink</dc:creator>
		<pubDate>Thu, 25 Mar 2010 02:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-44940</guid>
		<description>很好很强大，特来感谢，在你博客中看到很多我想去用代码实现可是还没有思路的东西，太喜欢了。</description>
		<content:encoded><![CDATA[<p>很好很强大，特来感谢，在你博客中看到很多我想去用代码实现可是还没有思路的东西，太喜欢了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-44829</link>
		<dc:creator>Denis</dc:creator>
		<pubDate>Sun, 28 Feb 2010 11:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-44829</guid>
		<description>英文的！</description>
		<content:encoded><![CDATA[<p>英文的！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tooko</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-44824</link>
		<dc:creator>tooko</dc:creator>
		<pubDate>Sat, 27 Feb 2010 05:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-44824</guid>
		<description>逗号用什么，中文的逗号还是用英文的逗号？</description>
		<content:encoded><![CDATA[<p>逗号用什么，中文的逗号还是用英文的逗号？</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 御用软件</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-43755</link>
		<dc:creator>御用软件</dc:creator>
		<pubDate>Sat, 07 Nov 2009 07:08:35 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-43755</guid>
		<description>恩，不错，按你的方法优化了下，谢谢了……
可到这里查看效果 :smile:  http://yyrj.org</description>
		<content:encoded><![CDATA[<p>恩，不错，按你的方法优化了下，谢谢了……<br />
可到这里查看效果 <img src='http://fairyfish.b0.upaiyun.com/smilies/icon_smile.gif' alt=':smile:' class='wp-smiley' />   <a href="http://yyrj.org" rel="nofollow">http://yyrj.org</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blinux</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-42748</link>
		<dc:creator>Blinux</dc:creator>
		<pubDate>Sun, 09 Aug 2009 01:26:28 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-42748</guid>
		<description>现在侧边栏可以通过wp kit cn来实现了
http://www.blinux.cn/wp-kit-cn/ :mrgreen:</description>
		<content:encoded><![CDATA[<p>现在侧边栏可以通过wp kit cn来实现了<br />
<a href="http://www.blinux.cn/wp-kit-cn/" rel="nofollow">http://www.blinux.cn/wp-kit-cn/</a> <img src='http://fairyfish.b0.upaiyun.com/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zouhu8</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-41579</link>
		<dc:creator>zouhu8</dc:creator>
		<pubDate>Mon, 08 Jun 2009 07:21:12 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-41579</guid>
		<description>由于编辑器原因 请使用代码的时候注意把“符号的全角改为半角</description>
		<content:encoded><![CDATA[<p>由于编辑器原因 请使用代码的时候注意把“符号的全角改为半角</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zouhu8</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-41578</link>
		<dc:creator>zouhu8</dc:creator>
		<pubDate>Mon, 08 Jun 2009 07:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-41578</guid>
		<description>看到楼上的问题没人回答，我就把我自己的沾上来吧
$dn=$description = utf8_trim(substr(strip_tags($post-&gt;post_content),0,220));
$dn = str_replace(array(&quot;\r\n&quot;,&quot;\r&quot;,&quot;\n&quot;,&quot;\&quot;&quot;,&quot; &quot;),&quot;&quot;,$dn);
详见：我的博客simplc.cn中:让你丢掉all in one seo pack方法</description>
		<content:encoded><![CDATA[<p>看到楼上的问题没人回答，我就把我自己的沾上来吧<br />
$dn=$description = utf8_trim(substr(strip_tags($post-&gt;post_content),0,220));<br />
$dn = str_replace(array(&#8220;\r\n&#8221;,&#8221;\r&#8221;,&#8221;\n&#8221;,&#8221;\&#8221;",&#8221; &#8220;),&#8221;",$dn);<br />
详见：我的博客simplc.cn中:让你丢掉all in one seo pack方法</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jazzi</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-41280</link>
		<dc:creator>jazzi</dc:creator>
		<pubDate>Fri, 22 May 2009 02:30:55 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-41280</guid>
		<description>和#46楼的同样的问题，

要解决前220字符换行的问题，#45楼笑林广记的代码应该放到哪个地方？

$description = str_replace(array(”\r\n”, “\r”, “\n”, ” “), ” “, $description);
$description = str_replace(array(”\”&quot;), “”, $description);</description>
		<content:encoded><![CDATA[<p>和#46楼的同样的问题，</p>
<p>要解决前220字符换行的问题，#45楼笑林广记的代码应该放到哪个地方？</p>
<p>$description = str_replace(array(”\r\n”, “\r”, “\n”, ” “), ” “, $description);<br />
$description = str_replace(array(”\”&#8221;), “”, $description);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-1/#comment-40832</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 28 Apr 2009 09:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-40832</guid>
		<description>请问：
function utf8_trim($str) {

$len = strlen($str);
$hex = ”;

for ($i=strlen($str)-1; $i&gt;=0; $i-=1){
$hex .= ‘ ‘.ord($str[$i]);
$ch = ord($str[$i]);
if (($ch &amp; 128)==0) return(substr($str,0,$i));
if (($ch &amp; 192)==192) return(substr($str,0,$i));
}
return($str.$hex);
}
应该加在什么位置？我不是程序员，请指教。</description>
		<content:encoded><![CDATA[<p>请问：<br />
function utf8_trim($str) {</p>
<p>$len = strlen($str);<br />
$hex = ”;</p>
<p>for ($i=strlen($str)-1; $i&gt;=0; $i-=1){<br />
$hex .= ‘ ‘.ord($str[$i]);<br />
$ch = ord($str[$i]);<br />
if (($ch &amp; 128)==0) return(substr($str,0,$i));<br />
if (($ch &amp; 192)==192) return(substr($str,0,$i));<br />
}<br />
return($str.$hex);<br />
}<br />
应该加在什么位置？我不是程序员，请指教。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wuai</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-1/#comment-40401</link>
		<dc:creator>wuai</dc:creator>
		<pubDate>Mon, 06 Apr 2009 08:58:09 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-40401</guid>
		<description>$description = str_replace(array(”\r\n”, “\r”, “\n”, ” “), ” “, $description);
$description = str_replace(array(”\”&quot;), “”, $description);
------------------------------------
上段具体应摆在下方这一段的哪一行后面？
--------------------------------------------------
post_excerpt) {
        $description     = $post-&gt;post_excerpt;
    } else {
        $description = substr(strip_tags($post-&gt;post_content),0,220);
    }
    $keywords = &quot;&quot;;       
    $tags = wp_get_post_tags($post-&gt;ID);
    foreach ($tags as $tag ) {
        $keywords = $keywords . $tag-&gt;name . &quot;, &quot;;
    }
}
?&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;&quot; /&gt;
&lt;meta name=&quot;description&quot; content=&quot;&quot; /&gt;
-------------------------------
试了好多次，总是出错，可能插错了位置。
另外，主页选择静态页面的某个页面时，好像无法看到主页的描述与关键词，有无解决办法？

先谢！</description>
		<content:encoded><![CDATA[<p>$description = str_replace(array(”\r\n”, “\r”, “\n”, ” “), ” “, $description);<br />
$description = str_replace(array(”\”&#8221;), “”, $description);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
上段具体应摆在下方这一段的哪一行后面？<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
post_excerpt) {<br />
        $description     = $post-&gt;post_excerpt;<br />
    } else {<br />
        $description = substr(strip_tags($post-&gt;post_content),0,220);<br />
    }<br />
    $keywords = &#8220;&#8221;;<br />
    $tags = wp_get_post_tags($post-&gt;ID);<br />
    foreach ($tags as $tag ) {<br />
        $keywords = $keywords . $tag-&gt;name . &#8220;, &#8220;;<br />
    }<br />
}<br />
?&gt;<br />
&lt;meta name=&#8221;keywords&#8221; content=&#8221;" /&gt;<br />
&lt;meta name=&#8221;description&#8221; content=&#8221;" /&gt;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
试了好多次，总是出错，可能插错了位置。<br />
另外，主页选择静态页面的某个页面时，好像无法看到主页的描述与关键词，有无解决办法？</p>
<p>先谢！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lunweninfo</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-39844</link>
		<dc:creator>lunweninfo</dc:creator>
		<pubDate>Sun, 15 Mar 2009 06:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-39844</guid>
		<description>关键词的逗号后面会有个空格，刚开始我以为是 $keywords = $keywords . $tag-&gt;name . “, “; 逗号后面有个空格的关系，就改了一下,结果导致全部出现乱码，请问怎样能解决这问题呢？</description>
		<content:encoded><![CDATA[<p>关键词的逗号后面会有个空格，刚开始我以为是 $keywords = $keywords . $tag-&gt;name . “, “; 逗号后面有个空格的关系，就改了一下,结果导致全部出现乱码，请问怎样能解决这问题呢？</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zhukun</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-39551</link>
		<dc:creator>zhukun</dc:creator>
		<pubDate>Fri, 06 Mar 2009 12:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-39551</guid>
		<description>很好很强大，我也可以抛弃All in One SEO Pack了！ :smile:</description>
		<content:encoded><![CDATA[<p>很好很强大，我也可以抛弃All in One SEO Pack了！ <img src='http://fairyfish.b0.upaiyun.com/smilies/icon_smile.gif' alt=':smile:' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Metoit</title>
		<link>http://fairyfish.net/2008/11/16/wordpress-seo-2-description-keywords/comment-page-2/#comment-38605</link>
		<dc:creator>Metoit</dc:creator>
		<pubDate>Sat, 07 Feb 2009 17:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://fairyfish.net/?p=1762#comment-38605</guid>
		<description>使用all in one seo pack了.懒得动手了 :oops:</description>
		<content:encoded><![CDATA[<p>使用all in one seo pack了.懒得动手了 <img src='http://fairyfish.b0.upaiyun.com/smilies/icon_redface.gif' alt=':oops:' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

