<?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/rst/wordpress/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>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>创建Thesis的自定义页面</title>
		<link>http://www.gexiaofei.com/20090306598.html</link>
		<comments>http://www.gexiaofei.com/20090306598.html#comments</comments>
		<pubDate>Fri, 06 Mar 2009 03:36:45 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Thesis]]></category>
		<category><![CDATA[Wordpress主题]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=598</guid>
		<description><![CDATA[最近把博客换到了Chris Pearson开发的Thesis主题，感觉非常强大，折腾Thesis也成了这几天的主要事情。网上有部分关于thesis的修改教程，但是更多的资料还是在收费会员才能查阅的论坛中，真是比较遗憾。
昨天因为要建立一个搜索结果的结果页面，要使用custom page templates，在网上找了N久都没发现如何在Thesis里建立自定义页面。只好反反复复的折腾，最后找到了办法，分享如下。
首先在创建页面（Page）的时候选择template为custom template。记下page的ID。
然后在custom_functions.php里面根据自己需要添加以下代码：
[php]
//自定义搜索页面
function my_page() {
if (is_page(&#8217;592&#8242;)) /*你的页面ID*/
{ ?>
//下面基本套用thesis现有的html代码



页面标题

你的页面内容，可以使用php或者html代码


//添加sidebar



]]></description>
			<content:encoded><![CDATA[<p></p><p>最近把博客换到了<a href="http://www.pearsonified.com/">Chris Pearson</a>开发的Thesis主题，感觉非常强大，折腾<a href="http://diythemes.com/?a_aid=feir">Thesis</a>也成了这几天的主要事情。网上有部分关于thesis的修改教程，但是更多的资料还是在收费会员才能查阅的论坛中，真是比较遗憾。</p>
<p>昨天因为要建立一个搜索结果的结果页面，要使用custom page templates，在网上找了N久都没发现如何在Thesis里建立自定义页面。只好反反复复的折腾，最后找到了办法，分享如下。</p>
<p>首先在创建页面（Page）的时候选择template为custom template。记下page的ID。</p>
<p>然后在custom_functions.php里面根据自己需要添加以下代码：<br />
[php]<br />
//自定义搜索页面<br />
function my_page() {<br />
if (is_page(&#8217;592&#8242;)) /*你的页面ID*/<br />
{ ?><br />
//下面基本套用thesis现有的html代码</p>
<div id="content">
<div class="post_box">
<div class="headline_area">
<h2>页面标题</h2>
</div>
<p>你的页面内容，可以使用php或者html代码
</p></div>
</div>
<p>//添加sidebar</p>
<div id="sidebars">
<?php thesis_build_sidebars(); ?>
</div>
<p><?php<br />
}<br />
}<br />
//去掉thesis默认的自定义模板，加载自己的模板<br />
remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');<br />
add_action('thesis_hook_custom_template', 'my_page');<br />
[/php]</p>
<p>要建立其他自定义页面只要在custom_functions.php里面添加新的function就可以了。另外关于hooks的介绍，可以参照Charles的<a href="http://sexywp.com/try-to-explain-hook-in-wp.htm">浅析WordPress中的Hook机制</a>，以及<a href="http://www.sugarrae.com/thesis-hooks-dummies-tutorial/">Thesis Hooks使用的教程</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20090306598.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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问题。
现在提供一个解决办法，通过在Wordpress主题的fuctions.php里添加一段PHP代码就可以。这个代码解决复制内容的思路是让各评论分页与文章主页的post内容显示不一样，评论分页上只显示文章摘要。
[php]function seo_paged_comments_content_filter($t = &#8221;) {
$cpage = intval(get_query_var(&#8217;cpage&#8217;));
if ( [...]]]></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/ （评论分页第一页）<br />
http://example.com/my-post-permalink/comment-page-2/（评论分页第二页）<br />
这几个页面的主体内容其实是一样的，页面文字除了具体评论有变化外其余的都一样，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(&#8217;cpage&#8217;));<br />
if ( ! empty( $cpage ) ) {<br />
remove_filter(&#8217;the_content&#8217;, &#8217;seo_paged_comments_content_filter&#8217;);<br />
$t = get_the_excerpt();<br />
$t .= sprintf(&#8217;
<p><a href="%1$s">%2$s</a></p>
<p>&#8216;, get_permalink(), get_the_title());<br />
}<br />
return $t;<br />
}<br />
add_filter(&#8217;the_content&#8217;, &#8217;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;
}
#login h1 {
display: none;
}
.login #nav a {
color: #777 !important;
}
.login #nav a:hover {
color: #bcb38f !important;
}

#wphead img, #wphead h1 {
display: none;
}
#wphead {
height: 100px;
}
#wphead-info [...]]]></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>easyComment：针对Wordpress的firefox快速评论插件</title>
		<link>http://www.gexiaofei.com/20081217461.html</link>
		<comments>http://www.gexiaofei.com/20081217461.html#comments</comments>
		<pubDate>Wed, 17 Dec 2008 03:02:12 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firefox插件]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=461</guid>
		<description><![CDATA[对于每天都在不同博客间留言的朋友来说，每次想要评论都要找到评论狂然后输入自己的信息是比较麻烦的事情。Firefox插件easyComment是个发表评论中毒用户的必备良药，可以实现在wordpress博客上One-Click评论留言。
在安装玩easyComment之后，点击firefox状态栏上的easycomment图标后会出现如图所示输入框。依次输入自己的内容后，就ok了。（Your message这栏不用填写，除非你每次留言都是同样的内容。。） 然后随便找个你经常上的wordpress博客，在任何文章页面的任何位置点击这个easycomment图标，easycomment插件会自动搜索评论框的位置并且自动输入你预填写的个人信息和内容，很是方便博客评论。
easycomment插件的具体介绍和下载地址在这里：http://blog.bf-itservice.de/82/easycomment-firefox-extension
]]></description>
			<content:encoded><![CDATA[<p></p><p>对于每天都在不同博客间留言的朋友来说，每次想要评论都要找到评论狂然后输入自己的信息是比较麻烦的事情。Firefox插件easyComment是个发表评论中毒用户的必备良药，可以实现在wordpress博客上One-Click评论留言。</p>
<p><img src="http://www.gexiaofei.com/wp-content/uploads/2008/12/easycomment.gif" alt="easycomment" title="easycomment" width="457" height="526" class="alignleft size-full wp-image-462" />在安装玩easyComment之后，点击firefox状态栏上的easycomment图标后会出现如图所示输入框。依次输入自己的内容后，就ok了。（Your message这栏不用填写，除非你每次留言都是同样的内容。。） 然后随便找个你经常上的wordpress博客，在任何文章页面的任何位置点击这个easycomment图标，easycomment插件会自动搜索评论框的位置并且自动输入你预填写的个人信息和内容，很是方便博客评论。</p>
<p>easycomment插件的具体介绍和下载地址在这里：<a href="http://blog.bf-itservice.de/82/easycomment-firefox-extension">http://blog.bf-itservice.de/82/easycomment-firefox-extension</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20081217461.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>创建基于Wordpress的OpenSearch应用</title>
		<link>http://www.gexiaofei.com/20081106369.html</link>
		<comments>http://www.gexiaofei.com/20081106369.html#comments</comments>
		<pubDate>Thu, 06 Nov 2008 15:09:58 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[OpenSearch]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=369</guid>
		<description><![CDATA[创建基于Wordpress的OpenSearch应用，直接在浏览器中搜索Wordpress博客。]]></description>
			<content:encoded><![CDATA[<p></p><p>Firefox和IE等浏览器的地址栏右边都有一个自带的搜索框，里面自带例如Google的搜索并且可以自己添加删除搜索引擎，这个就是OpenSearch的应用。关于OpenSearch的详细说明，可以查阅其<a href="http://www.opensearch.org/">官方网站</a>。使用OpenSearch技术应用，可以您的网站创建一个自定义搜索，访问者可以将网站搜索添加到他们的浏览器搜索栏中，此后就可以直接从他们的浏览器搜索栏中搜索网站内容，就像他们可以从同一界面上搜索Google或其他搜索引擎，而不需要单独打开网站页面。</p>
<p>Wordpress博客更加容易使用OpenSearch应用，因为其自身支持OpenSearch并且OpenSearch所需要的XML文件非常容易制作。譬如我的博客上就实现了OpenSearch，并且我添加到firefox浏览器中。<a href="http://www.gexiaofei.com/wp-content/uploads/2008/11/screenshot00073.jpg"><img src="http://www.gexiaofei.com/wp-content/uploads/2008/11/screenshot00073.jpg" alt="" title="OpenSearch" width="269" height="170" class="alignright size-medium wp-image-370" /></a></p>
<p>Wordpress使用OpenSearch应用的方法很简单，两步：首先，在Wordpress主题模板的header.php里加上代码<coolcode>
<link rel="search" type="application/opensearchdescription+xml" title="<?php bloginfo('name'); ?>&#8221; href=&#8221;<?php bloginfo('url'); ?>/os.xml&#8221; /></coolcode><br />
然后创建一个os.xml文件并上传到博客根目录下就可以了。os.xml内容如下，根据各自网站进行修改就行。<br />
<coolcode><?xml version="1.0" encoding="UTF-8"?><br />
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"><br />
	<ShortName>天眞博客</ShortName><br />
	<Description>Search on gexiaofei.com blog.</Description><br />
	<Url type="text/html" method="get" template="http://www.gexiaofei.com/?s={searchTerms}"></Url><br />
	<Contact>gexiaofei@vip.qq.com</Contact><br />
	<LongName>Gexiaofei.com Blog Search</LongName><br />
	<Image height="16" width="16" type="image/x-icon">http://www.gexiaofei.com/favicon.ico</Image><br />
	<Tags>Weblog WordPress Webdevelopment</Tags><br />
	<Url type="application/atom+xml" template="http://www.gexiaofei.com/?q={searchTerms}&amp;pw={startPage?}&amp;format=atom"/><br />
	<Url type="application/rss+xml" template="http://http://www.gexiaofei.com/?q={searchTerms}&amp;pw={startPage?}&amp;format=rss"/><br />
	<Url type="text/html" template="http://http://www.gexiaofei.com/?q={searchTerms}&amp;pw={startPage?}"/><br />
	<Query role="example" searchTerms="blog"/><br />
	<Developer>Frank Bueltge</Developer><br />
	<Attribution><br />
	    Search data Copyright 2007, All Rights Reserved<br />
	</Attribution><br />
	<SyndicationRight>open</SyndicationRight><br />
	<AdultContent>false</AdultContent><br />
	<Language>de-DE</Language><br />
	<OutputEncoding>UTF-8</OutputEncoding><br />
	<InputEncoding>UTF-8</InputEncoding><br />
</OpenSearchDescription></coolcode></p>
<p>这个应用对于一些站内搜索比较多的博客有用，可以很方便的让用户直接从浏览器中查找博客内容，而不需要每次登陆博客输入搜索。如果你感兴趣，可以添加我的博客搜索到你的firefox或者IE7，尝试一下是否方便很多。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20081106369.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress 2.7要来了</title>
		<link>http://www.gexiaofei.com/20081104365.html</link>
		<comments>http://www.gexiaofei.com/20081104365.html#comments</comments>
		<pubDate>Tue, 04 Nov 2008 14:25:30 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=365</guid>
		<description><![CDATA[Wordpress 2.7 要来了，很多功能性的提升和互动的增强，只是个人博客用户到底会用到多少功能呢?]]></description>
			<content:encoded><![CDATA[<p></p><p>迟到的消息，今天看google reader才知道Wordpress 2.7要来了。Wordpress的这次更新据说<a href="http://codex.wordpress.org/Version_2.7">有很多的变化</a>，功能方面也有很大的提高。我觉得除了基本效能方面的提升以外，对我这个一直没时间没内容更新的博客基本没有什么影响。</p>
<p>Thread Comments这个东西对于评论不多的网站用处并不大，尤其是要实现这种回复式评论需要对博客主题的comments.php文件进行很大的修改很有可能让一些人望而却步。针对评论的快捷键设置（Keyboard shortcuts）和评论分页也只有评论多的博客有用，对我么有用处哇:( 这次2.7的功能更新让我感觉wordpress已经逐渐抛弃人气弱的博客用户，因为这些功能所能带来的挫折感估计会很强，譬如我。。</p>
<p>从早期的wordpress用到现在，可以很明显的感觉到wordpress前进的步伐很快，除了用户体验和功能方面的提升，也更加重视互动的实现，博客平台本来就是个互动的平台，wordpress也越来越社会化了。不过个人博客平台能用到的功能到底有多少呢？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20081104365.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wordpress技巧备忘</title>
		<link>http://www.gexiaofei.com/200803239.html</link>
		<comments>http://www.gexiaofei.com/200803239.html#comments</comments>
		<pubDate>Sun, 23 Mar 2008 12:17:13 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/?p=9</guid>
		<description><![CDATA[Wordpress技巧备忘，包含linkroll控制、文章过滤以及单独分类搜索等等。]]></description>
			<content:encoded><![CDATA[<p></p><p>折腾了两天的wordpress 2.5，做出了两个wordpress模板，一个就是这个博客上用的Simjr,另外一个暂时不公布了。Simjr是比较简洁的主题，没有多加什么功能，但是在做另外个主题的时候要添加很多个性化的东西，所以查阅了一些老外的博客，收录了不少很酷的wordpress技巧，留存这里备忘。</p>
<ul>
<li>控制linkroll显示顺序</li>
<ol class="code">
<li><code>&lt;?php wp_list_bookmarks('title_li=&amp;orderby=description&amp;order=ASC&amp;categorize=0'); ?&gt;</code></li>
<li></li>
</ol>
<li>过滤单篇日志</li>
<p>如果某篇文章需要在wordpress博客文章列表、搜索结果或者其他任何地方不显示的话，可以使用下面语句。</p>
<ol class="code">
<li><code>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); if( $post-&gt;ID == '179' ) continue; ?&gt;</code></li>
<li><code>&lt;?php the_content();?&gt;</code></li>
<li><code>&lt;?php endwhile;endif;?&gt;</code></li>
</ol>
<li>只有登陆会员可见内容</li>
<ol class="code">
<li><code>&lt;?php if (is_user_logged_in()) : ?&gt;</code></li>
<li class="indent1"><code>&lt;?php global $user_identity;get_currentuserinfo();?&gt;</code></li>
<li></li>
<li class="indent1"><code>&lt;p&gt;Welcome back &lt;?php echo $user_identity;?&gt;&lt;/p&gt;</code></li>
<li class="indent1"><code>&lt;p&gt;Here is a list of private pages only viewable by Members:&lt;/p&gt;</code></li>
<li class="indent2"><code>&lt;ul&gt;</code></li>
<li class="indent4"><code>&lt;?php wp_list_pages('title_li=&amp;child_of=20'); ?&gt;</code></li>
<li class="indent2"><code>&lt;/ul&gt;</code></li>
<li><code>&lt;?php else <img src='http://www.gexiaofei.com/wp-includes/images/smilies/icon_confused.gif' alt=':?' class='wp-smiley' /> &gt;</code></li>
<li class="indent1"><code>Welcome, visitor!</code></li>
<li><code>&lt;?php endif;?&gt;</code></li>
</ol>
<li>限制目录搜索</li>
<p>如果想让搜索只在某个目录分类下进行的话</p>
<ol class="code">
<li><code>&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('home'); ?&gt;/&quot;&gt;</code></li>
<li><code>&lt;div&gt;&lt;input type=&quot;text&quot; value=&quot;&lt;?php echo wp_specialchars($s, 1); ?&gt;&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;</code></li>
<li><code>&lt;input type=&quot;hidden&quot; name=&quot;cat&quot; value=&quot;22&quot; /&gt;</code></li>
<li><code>&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Search&quot; /&gt;</code></li>
<li><code>&lt;/div&gt;</code></li>
<li><code>&lt;/form&gt;</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/200803239.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>自定义WordPress数据库错误信息页面</title>
		<link>http://www.gexiaofei.com/20080101330.html</link>
		<comments>http://www.gexiaofei.com/20080101330.html#comments</comments>
		<pubDate>Tue, 01 Jan 2008 11:08:55 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/blog/20080101278.html</guid>
		<description><![CDATA[Wordpress 2.3.2开始允许用户自定义数据库错误页面，这点对于虚拟主机数据库连接不稳定的wordpress用户来说很有用。]]></description>
			<content:encoded><![CDATA[<p></p><p>Wordpress 2.3.2版本允许用户自定义wordpress数据库错误信息页面，这个功能对于mysql主机不稳定的朋友来说是很有用的。当wordpress与数据库链接出现问题的时候，就会显示你的自定义内容，而不是wordpress自动的错误信息提示。</p>
<p>过程很简单，创建一个<code>db-error.php</code>页面，然后保存到<code>wp-content</code>目录下面就OK了。对这个页面，可以当成一个普通的页面进行创造，甚至运用CSS来装饰一下。最简单的wordpress数据库错误页面如下：</p>
<ol class="code">
<li><code>&lt;html&gt;</code></li>
<li><code>&lt;head&gt;</code></li>
<li><code>WORDPRESS数据库错误</code></li>
<li><code>&lt;/head&gt;</code></li>
<li><code>&lt;body&gt;</code></li>
<li><code>WORDPRESS数据库连接出现错误，请稍后访问。</code></li>
<li><code>&lt;/body&gt;</code></li>
<li><code>&lt;/html&gt;</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20080101330.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>仿校内的WordPress模板</title>
		<link>http://www.gexiaofei.com/20071230323.html</link>
		<comments>http://www.gexiaofei.com/20071230323.html#comments</comments>
		<pubDate>Sat, 29 Dec 2007 20:51:59 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/blog/20071230267.html</guid>
		<description><![CDATA[将校内的模板移植到WORDPRESS上来，基本让WORDPRESS博客和校内界面和功能看上去有点类似。]]></description>
			<content:encoded><![CDATA[<p></p><p>花了一个晚上，把校内的模板偷到了WordPress上来了。还是没有完全做好，先抓图示意下。一直挺喜欢校内的样子的，过几天搬到博客上来。</p>
<p>校内模板首页：<br />
<a href='http://www.gexiaofei.com/wp-content/uploads/2007/12/xiaonei-index.jpg' title='仿校内的WORDPRESS模板首页'><img src='http://www.gexiaofei.com/wp-content/uploads/2007/12/xiaonei-index.jpg' alt='仿校内的WORDPRESS模板首页' /></a><br />
很喜欢校内左侧导航和下面的广告区块，都偷过来了，包括那个更多功能。</p>
<p>校内模板文章页面：<br />
<a href='http://www.gexiaofei.com/wp-content/uploads/2007/12/xiaonei-single.jpg' title='仿校内的WORDPRESS模板文章页面'><img src='http://www.gexiaofei.com/wp-content/uploads/2007/12/xiaonei-single.jpg' alt='仿校内的WORDPRESS模板文章页面' /></a><br />
抄袭的校内里面在看别人博客文章的时候会显示出作者的头像和相关信息。</p>
<p>校内模板评论界面：<br />
<a href='http://www.gexiaofei.com/wp-content/uploads/2007/12/xiaonei-comment.jpg' title='仿校内的WORDPRESS模板评论界面'><img src='http://www.gexiaofei.com/wp-content/uploads/2007/12/xiaonei-comment.jpg' alt='仿校内的WORDPRESS模板评论界面' /></a><br />
回复功能、表情功能。只是现在的表情图片太丑点，要把校内的表情图也偷过来。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20071230323.html/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Wordpress自动升级脚本</title>
		<link>http://www.gexiaofei.com/20071106255.html</link>
		<comments>http://www.gexiaofei.com/20071106255.html#comments</comments>
		<pubDate>Tue, 06 Nov 2007 11:10:40 +0000</pubDate>
		<dc:creator>天眞</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress插件]]></category>

		<guid isPermaLink="false">http://www.gexiaofei.com/blog/20071106191.html</guid>
		<description><![CDATA[wordpress自动升级脚本，如果拥有服务器shell权限的话升级wordpress非常简单。]]></description>
			<content:encoded><![CDATA[<p></p><p>前几天用shell命令的时候一个失手，把服务器上一个存放多个英文网站的文件夹给删了，尸骨无存。最最郁闷的是这些网站的主题大多数都是我个性化修改过的，现在连个备份都没有了。重新做这些wordpress博客是很痛苦的，到现在也刚修复了两个。</p>
<p>网站资料丢失的事情我遇到过很多次了，最严重的是去年我们自己购买的服务器硬盘损坏，文件带数据库通通丢失。最郁闷的是，我从来没有在本地备份的习惯，所有的操作都是在服务器上进行。看来以后要好好改改这个坏习惯了。</p>
<p>在整理插件的过程中，<a href="http://planetozh.com/blog/2007/10/wordpress-upgrade-script/">发现</a>了一个很好用的wordpress自动升级脚本，非常好用。不过要使用这个wordpress脚本的前提是你需要有服务器的shell权限。</p>
<ol class="code">
<li><code>#!/bin/bash</code></li>
<li><code>CURDIR=$(pwd)</code></li>
<li><code>SITE=&quot;http://yoursite.com/blog&quot;</code></li>
<li><code>echo Updating Wordpress in $CURDIR</code></li>
<li><code>echo 1.  downloading latest build</code></li>
<li><code>wget -q http://wordpress.org/latest.tar.gz</code></li>
<li><code>echo 2.  unpacking latest build</code></li>
<li><code>tar zxf latest.tar.gz</code></li>
<li><code>cd wordpress/</code></li>
<li><code>echo 3.  replacing old files with fresh ones</code></li>
<li><code>tar cf - . | (cd $CURDIR; tar xf -)</code></li>
<li><code>echo 4.  updating your blog</code></li>
<li><code>wget -q -O - ${SITE}/wp-admin/upgrade.php?step=1&gt; /dev/null</code></li>
<li><code>echo 5.  removing unneeded files and directory</code></li>
<li><code>rm -f ../latest.tar.gz</code></li>
<li><code>echo 6.  all done !</code></li>
</ol>
<p>手动过程很简单，把文件保存名为<code>updatewp</code>（不带文件名后缀），放到wordpress根目录下，修正文件权限<code>chmod +x updatewp</code>，最后输入<code> ./updatewp</code>就ok了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gexiaofei.com/20071106255.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
