<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>葛小飞 &#187; wordpress技巧</title>
	<atom:link href="http://www.gexiaofei.com/tag/wordpress%e6%8a%80%e5%b7%a7/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gexiaofei.com</link>
	<description>惟愿生活简单前行</description>
	<lastBuildDate>Wed, 08 Apr 2009 15:48:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress 2.7 分页评论导致的SEO问题</title>
		<link>http://www.gexiaofei.com/20081218469.html</link>
		<comments>http://www.gexiaofei.com/20081218469.html#comments</comments>
		<pubDate>Thu, 18 Dec 2008 15:20:12 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress技巧]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=469</guid>
		<description><![CDATA[WordPress 2.7的评论分页功能对于评论比较多的博客而言是个很好的功能，可以有效的减少页面体积，但是同时分页评论功能也会造成一个与SEO相关的问题——复制内容。wp-hackers邮件组里就有人指出这个问题了。 Isn&#8217;t this bad for SEO? We now have a post with multiple pages, but the post content is repeated over multiple URLs. This will screw up search engines, as well as site stats (popular posts will end up &#8220;splitting the vote&#8221; between comment-page-1, comment-page-2, comment-page-3, etc&#8230;) 对于开启了分页评论的文章页面，wordpress是使用以下URL格式来对各个分页进行标记的： http://example.com/my-post-permalink/ （文章页面主页） http://example.com/my-post-permalink/comment-page-1/ （评论分页第一页） http://example.com/my-post-permalink/comment-page-2/（评论分页第二页） 这几个页面的主体内容其实是一样的，页面文字除了具体评论有变化外其余的都一样，title是一样的，meta内容也是一样的。所以就有人质疑，分页评论是否会为WordPress2.7博客增加复制内容这一SEO问题。 [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>WordPress 2.7的评论分页功能对于评论比较多的博客而言是个很好的功能，可以有效的减少页面体积，但是同时分页评论功能也会造成一个与SEO相关的问题——复制内容。wp-hackers邮件组里就有人指出<a href="http://comox.textdrive.com/pipermail/wp-hackers/2008-December/023189.html">这个问题</a>了。</p>
<blockquote><p>Isn&#8217;t this bad for SEO?  We now have a post with multiple pages, but<br />
the post content is repeated over multiple URLs.  This will screw up<br />
search engines, as well as site stats (popular posts will end up<br />
&#8220;splitting the vote&#8221; between comment-page-1, comment-page-2, comment-page-3, etc&#8230;)</p></blockquote>
<p>对于开启了分页评论的文章页面，wordpress是使用以下URL格式来对各个分页进行标记的：<br />
http://example.com/my-post-permalink/ （文章页面主页）<br />
http://example.com/my-post-permalink/comment-page-1/ （评论分页第一页）</p>
<p>http://example.com/my-post-permalink/comment-page-2/（评论分页第二页）</p>
<p>这几个页面的主体内容其实是一样的，页面文字除了具体评论有变化外其余的都一样，title是一样的，meta内容也是一样的。所以就有人质疑，分页评论是否会为WordPress2.7博客增加复制内容这一SEO问题。</p>
<p>现在提供一个解决办法，通过在WordPress主题的fuctions.php里添加一段PHP代码就可以。这个代码解决复制内容的思路是让各评论分页与文章主页的post内容显示不一样，评论分页上只显示文章摘要。</p>
<p>[php]function seo_paged_comments_content_filter($t = &#8221;) {<br />
$cpage = intval(get_query_var(&#8216;cpage&#8217;));<br />
if ( ! empty( $cpage ) ) {<br />
remove_filter(&#8216;the_content&#8217;, &#8216;seo_paged_comments_content_filter&#8217;);<br />
$t = get_the_excerpt();<br />
$t .= sprintf(&#8216;
<p><a href="%1$s">%2$s</a></p>
<p>&#8216;, get_permalink(), get_the_title());<br />
}<br />
return $t;<br />
}<br />
add_filter(&#8216;the_content&#8217;, &#8216;seo_paged_comments_content_filter&#8217;);[/php]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20081218469.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>美化WordPress登陆页面</title>
		<link>http://www.gexiaofei.com/20081217464.html</link>
		<comments>http://www.gexiaofei.com/20081217464.html#comments</comments>
		<pubDate>Wed, 17 Dec 2008 15:01:01 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress技巧]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=464</guid>
		<description><![CDATA[在WordPress 2.6的使用过程中，我也曾经对WP的登陆页面进行过自定义，包括修改其样式，或者改变页面内容。现在WordPress升级到2.7了，WP开发者对登陆页面进行了一些改动，但是要实现登陆页面的美化还是不复杂的，Frank就提供了一个简单的方法。 首先，在你的主题的functions.php里添加以下代码，如果你的主题没有functions.php，可以自己建立一个。 function fb_custom_login() { echo '&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; href=&#34;' . get_bloginfo('template_directory') . '/custom-login/custom-login.css&#34; /&#62;'; } add_action('login_head', 'fb_custom_login'); 这是要求WordPress对登陆页面使用独立的css样式表custom-login.css，该样式表是放在主题目录下的custom-login文件夹。 custom-login.css的内容可以自己做，完全可以打造出符合自己网站风格的WordPress登陆页面来。如果比较懒惰，也可以使用以下的css html { background-color: #fff; } #login form { padding-top: 100px; } #login form .submit input { border-color: #bcb38f !important; color: #777 !important; } #login form .submit input:hover { border-color: #bcb38f !important; color: #bcb38f !important; [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>在WordPress 2.6的使用过程中，我也曾经对WP的登陆页面进行过自定义，包括修改其样式，或者改变页面内容。现在WordPress升级到2.7了，WP开发者对登陆页面进行了一些改动，但是要实现登陆页面的美化还是不复杂的，Frank就提供了一个<a href="http://wpengineer.com/create-your-own-wordpress-login-design/">简单的方法</a>。<br />
<img src="http://wpengineer.com/blog/wp-content/uploads/wp27-login.png" alt="美化WordPress登陆页面" /><br />
首先，在你的主题的functions.php里添加以下代码，如果你的主题没有functions.php，可以自己建立一个。</p>
<ol class="code">
<li><code>function fb_custom_login() {</code></li>
<li><code>echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;' . get_bloginfo('template_directory') . '/custom-login/custom-login.css&quot; /&gt;';</code></li>
<li><code>}</code></li>
<li></li>
<li><code>add_action('login_head', 'fb_custom_login');</code></li>
</ol>
<p>这是要求WordPress对登陆页面使用独立的css样式表custom-login.css，该样式表是放在主题目录下的custom-login文件夹。</p>
<p>custom-login.css的内容可以自己做，完全可以打造出符合自己网站风格的WordPress登陆页面来。如果比较懒惰，也可以使用以下的css</p>
<ol class="code">
<li><code>html {</code></li>
<li><code>background-color: #fff;</code></li>
<li><code>}</code></li>
<li></li>
<li><code>#login form {</code></li>
<li><code>padding-top: 100px;</code></li>
<li><code>}</code></li>
<li><code>#login form .submit input {</code></li>
<li><code>border-color: #bcb38f !important;</code></li>
<li><code>color: #777 !important;</code></li>
<li><code>}</code></li>
<li><code>#login form .submit input:hover {</code></li>
<li><code>border-color: #bcb38f !important;</code></li>
<li><code>color: #bcb38f !important;</code></li>
<li><code>}</code></li>
<li><code>#login h1 {</code></li>
<li><code>display: none;</code></li>
<li><code>}</code></li>
<li><code>.login #nav a {</code></li>
<li><code>color: #777 !important;</code></li>
<li><code>}</code></li>
<li><code>.login #nav a:hover {</code></li>
<li><code>color: #bcb38f !important;</code></li>
<li><code>}</code></li>
<li></li>
<li><code>#wphead img, #wphead h1 {</code></li>
<li><code>display: none;</code></li>
<li><code>}</code></li>
<li><code>#wphead {</code></li>
<li><code>height: 100px;</code></li>
<li><code>}</code></li>
<li><code>#wphead-info {</code></li>
<li><code>padding-top: 27px;</code></li>
<li><code>}</code></li>
<li></li>
<li><code>#footer {</code></li>
<li><code>display: none;</code></li>
<li><code>}</code></li>
<li><code>#footer_custom {</code></li>
<li><code>clear: both;</code></li>
<li><code>text-align: center;</code></li>
<li><code>width: 500px;</code></li>
<li><code>margin: auto;</code></li>
<li><code>height: 100px;</code></li>
<li><code>}</code></li>
<li><code>#footer_custom .docs {</code></li>
<li><code>padding-top: 0px;</code></li>
<li><code>line-height: 100%;</code></li>
<li><code>}</code></li>
<li><code>#footer_image {</code></li>
<li><code>border:none;</code></li>
<li><code>}</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20081217464.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress博客个性化修改技巧</title>
		<link>http://www.gexiaofei.com/20071008170.html</link>
		<comments>http://www.gexiaofei.com/20071008170.html#comments</comments>
		<pubDate>Mon, 08 Oct 2007 14:35:19 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress技巧]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/blog/2007100899.html</guid>
		<description><![CDATA[wordpress博客的个性化修改技巧，怎样在WP博客首页个性化显示广告或其他自定义内容。]]></description>
			<content:encoded><![CDATA[<p></p><h2>WordPress个性化修改技巧之首页篇</h2>
<ul>
<li>
1、在wordpress博客首页第一篇文章下展示广告。</li>
</ul>
<p>在模板修改中打开index.php，找到以下代码：</p>
<ol class="code">
<li><code>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;</code></li>
</ol>
<p>在这段代码上方，加入</p>
<ol class="code">
<li><code>&lt;?php</code></li>
<li><code>$postnum = 1;</code></li>
<li><code>$showad1 = 1;</code></li>
<li><code>?&gt;</code></li>
</ol>
<p>找到下面的代码：</p>
<ol class="code">
<li><code>&lt;?php endwhile; ?&gt;</code></li>
</ol>
<p>在棋上方加入以下代码：</p>
<ol class="code">
<li><code>&lt;?php if ($postnum == $showad1) {</code></li>
<li><code>echo '</code></li>
<li><code>你的广告代码</code></li>
<li><code>';</code></li>
<li><code>} ?&gt;</code></li>
<li><code>&lt;?php $postnum++; ?&gt;[/coolcode]</code></li>
</ol>
<p>上面的代码可以实现在博客首页第一篇文章下显示广告，如果你想在第二篇或者第三篇文章后显示广告的话，可以将第一段代码中的$showad1 = 1改成$showad1 = 2或3。</p>
<ul>
<li>2、在第一篇文章和第二篇文章下展示不同广告。</li>
</ul>
<p>依旧是上述的几个修改地方，依次添加以下代码：</p>
<ol class="code">
<li><code>&lt;?php</code></li>
<li><code>$postnum = 1;</code></li>
<li><code>$showad1 = 1;</code></li>
<li><code>$showad2 = 2;</code></li>
<li><code>?&gt;</code></li>
<li><code>&lt;?php if ($postnum == $showad1) {</code></li>
<li><code>echo '</code></li>
<li><code>广告代码A</code></li>
<li><code>';</code></li>
<li><code>} ?&gt;</code></li>
<li><code>&lt;?php if ($postnum == $showad2) {</code></li>
<li><code>echo '</code></li>
<li><code>广告代码B</code></li>
<li><code>';</code></li>
<li><code>} ?&gt;</code></li>
<li><code>&lt;?php $postnum++; ?&gt;</code></li>
</ol>
<p>以上虽然说的是在wordpress博客首页添加广告，实际上你可以在这里显示任何需要的内容。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20071008170.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
