<?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>Power by Result Search &#187; wordpress tips</title>
	<atom:link href="http://www.result-search.com/sty/category/technology/create-your-personal-blog/wordpress-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.result-search.com/sty</link>
	<description>Just another weblog</description>
	<lastBuildDate>Wed, 23 Jun 2010 03:12:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory</title>
		<link>http://www.result-search.com/sty/2009/12/07/giving-wordpress-its-own-directory-while-leaving-your-blog-in-the-root-directory.html</link>
		<comments>http://www.result-search.com/sty/2009/12/07/giving-wordpress-its-own-directory-while-leaving-your-blog-in-the-root-directory.html#comments</comments>
		<pubDate>Mon, 07 Dec 2009 08:41:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>
		<category><![CDATA[wordpress directory]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=1232</guid>
		<description><![CDATA[Many people want WordPress to power their site&#8217;s root (e.g. http://example.com) but they don&#8217;t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root.
The process to move WordPress into its own directory is as [...]]]></description>
			<content:encoded><![CDATA[<p><!--:en-->Many people want WordPress to power their site&#8217;s root (e.g. <tt>http://example.com</tt>) but they don&#8217;t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root.<!--:--><span id="more-1232"></span><!--:en--></p>
<p>The process to move WordPress into its own directory is as follows:</p>
<ol>
<li> Create the new location for the core WordPress files to be stored (we will use <tt>/wordpress</tt> in our examples). (On linux, use mkdir wordpress from your www directory. You&#8217;ll probably want to use &#8220;chown apache:apache&#8221; on the wordpress directory you created.)</li>
<li> Go to the <a title="Administration Panels" href="http://codex.wordpress.org/Administration_Panels#Settings">General</a> panel.</li>
<li> In the box for <strong>WordPress address (URL):</strong> change the address to the new location of your main WordPress core files. Example: <tt>http://example.com/wordpress</tt></li>
<li> In the box for <strong>Blog address (URL):</strong> change the address to the root directory&#8217;s URL. Example: <tt>http://example.com</tt></li>
<li> Click <strong>Update Options</strong>. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.)</li>
<li> Move your WordPress core files to the new location (WordPress address).</li>
<li> Copy the <tt>index.php</tt> and <tt>.htaccess</tt> files from the WordPress directory into the root directory of your site (Blog address). The <tt>.htaccess</tt> file is invisible, so you may have to set your FTP client to <a title="Changing File Permissions" href="http://codex.wordpress.org/Changing_File_Permissions#Unhide_the_hidden_files">show hidden files</a>. If you are not using <a title="Using Permalinks" href="http://codex.wordpress.org/Using_Permalinks#Using_.22Pretty.22_permalinks">pretty permalinks</a>, then you may not have a .<tt>htaccess</tt> file.</li>
<li> Open your root directory&#8217;s <tt>index.php</tt> file in a <a title="Glossary" href="http://codex.wordpress.org/Glossary#Text_editor">text editor</a></li>
<li> Change the following and save the file. Change the line that says:<br />
<tt>require('./wp-blog-header.php');</tt><br />
to the following, using your directory name for the WordPress core files:<br />
<tt>require('./wordpress/wp-blog-header.php');</tt></li>
<li> Login to the new location. It might now be <tt>http://example.com/wordpress/wp-admin/</tt></li>
<li> If you have set up <a title="Using Permalinks" href="http://codex.wordpress.org/Using_Permalinks">Permalinks</a>, go to the <a title="Administration Panels" href="http://codex.wordpress.org/Administration_Panels#Permalinks">Permalinks panel</a> and update your Permalink structure. WordPress will automatically update your <tt>.htaccess</tt> file if it has the appropriate file permissions. If WordPress can&#8217;t write to your <tt>.htaccess</tt> file, it will display the new rewrite rules to you, which you should manually copy into your <tt>.htaccess</tt> file (in the same directory as the main <tt>index.php</tt> file.)</li>
</ol>
<p><!--:--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/12/07/giving-wordpress-its-own-directory-while-leaving-your-blog-in-the-root-directory.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress query_posts()</title>
		<link>http://www.result-search.com/sty/2009/09/20/wordpress-query_posts.html</link>
		<comments>http://www.result-search.com/sty/2009/09/20/wordpress-query_posts.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 13:15:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/2009/09/20/wordpress-query_posts.html</guid>
		<description><![CDATA[将query_posts()放在LOOP之前限定你所需要的条件，wp_query会产生一个新的使用你的参数的SQL查询，而忽视通过URL接收到的其它的参数，如果想不忽略，可以在调用中使用$query_string。
query_posts($query_string . &#8220;&#038;order=ASC&#8221;)
设置文章显示的顺序，但是不干扰其余的查询字符串，参数前须有“&#038;”符号
其他还有N多用途~~
    * 主页不显示某一分类下的日志

    * 获得特定的日志

    * 获得特定的页面



    * 创建所有文章列表，并且提供分页功能

==========================================
类别 参数
显示属于某个类别的文章
    * cat
    * category_name
根据ID显示一个类别
只显示来自一个类别ID的文章
query_posts(&#8216;cat=4&#8242;);
根据名称显示一个类别
只显示属于某个类别名的文章
query_posts(&#8216;category_name=Staff Home&#8217;);
显示几个类别及ID
显示属于几个类别ID的文章
query_posts(&#8216;cat=2,6,17,38&#8242;);
删除某个类别的文章
显示所有的文章，但是类别ID前面有个’-’（负号）负号的类被除外。
query_posts(&#8216;cat=-3&#8242;);
删除属于类别3的所有文章。有一个限制性条款：会删除只属于类别3的所有文章。如果一个类别也同时属于其它的类别，这个类别仍然不会被删除。
标签参数
显示与某个标签相关的文章
    * tag
为某个标签提取文章
query_posts(&#8216;tag=cooking&#8217;);
获得拥有任何这样的标签的文章
query_posts(&#8216;tag=bread,baking&#8217;);
获取拥有这三个标签的文章
query_posts(&#8216;tag=bread+baking+recipe&#8217;);
作者参数
你也可以根据作者限制文章数目
    * author_name=Harriet
    * author=3
author_name在 user_nicename区操作, 同时作者 在作者id上操作。
文章 &#038; 网页参数
返回一篇单独的文章或者一个单独的网页
 [...]]]></description>
			<content:encoded><![CDATA[<p><!--:zh-->将query_posts()放在LOOP之前限定你所需要的条件，wp_query会产生一个新的使用你的参数的SQL查询，而忽视通过URL接收到的其它的参数，如果想不忽略，可以在调用中使用$query_string。</p>
<p>query_posts($query_string . &#8220;&#038;order=ASC&#8221;)</p>
<p>设置文章显示的顺序，但是不干扰其余的查询字符串，参数前须有“&#038;”符号</p>
<p>其他还有N多用途~~</p>
<p>    * 主页不显示某一分类下的日志</p>
<p><?php<br />
   if (is_home()) {<br />
      query_posts("cat=-3");<br />
   }<br />
?></p>
<p>    * 获得特定的日志</p>
<p><?php<br />
query_posts('p=5');<br />
?></p>
<p>    * 获得特定的页面</p>
<p><?php<br />
query_posts('page_id=7');      //只返回网页7<br />
?></p>
<p><?php<br />
query_posts('pagename=about'); //只返回关于网页<br />
?></p>
<p><?php<br />
query_posts('pagename=parent/child'); // 返回母网页的子网页<br />
?></p>
<p>    * 创建所有文章列表，并且提供分页功能</p>
<p><?php<br />
query_posts($query_string.'posts_per_page=-1');<br />
while(have_posts()) { the_post();<br />
put your loop here ;<br />
}<br />
?></p>
<p>==========================================<br />
类别 参数</p>
<p>显示属于某个类别的文章</p>
<p>    * cat<br />
    * category_name</p>
<p>根据ID显示一个类别</p>
<p>只显示来自一个类别ID的文章</p>
<p>query_posts(&#8216;cat=4&#8242;);</p>
<p>根据名称显示一个类别</p>
<p>只显示属于某个类别名的文章</p>
<p>query_posts(&#8216;category_name=Staff Home&#8217;);</p>
<p>显示几个类别及ID</p>
<p>显示属于几个类别ID的文章</p>
<p>query_posts(&#8216;cat=2,6,17,38&#8242;);</p>
<p>删除某个类别的文章</p>
<p>显示所有的文章，但是类别ID前面有个’-’（负号）负号的类被除外。</p>
<p>query_posts(&#8216;cat=-3&#8242;);</p>
<p>删除属于类别3的所有文章。有一个限制性条款：会删除只属于类别3的所有文章。如果一个类别也同时属于其它的类别，这个类别仍然不会被删除。<br />
标签参数</p>
<p>显示与某个标签相关的文章</p>
<p>    * tag</p>
<p>为某个标签提取文章</p>
<p>query_posts(&#8216;tag=cooking&#8217;);</p>
<p>获得拥有任何这样的标签的文章</p>
<p>query_posts(&#8216;tag=bread,baking&#8217;);</p>
<p>获取拥有这三个标签的文章</p>
<p>query_posts(&#8216;tag=bread+baking+recipe&#8217;);</p>
<p>作者参数</p>
<p>你也可以根据作者限制文章数目</p>
<p>    * author_name=Harriet<br />
    * author=3</p>
<p>author_name在 user_nicename区操作, 同时作者 在作者id上操作。<br />
文章 &#038; 网页参数</p>
<p>返回一篇单独的文章或者一个单独的网页</p>
<p>    * p=1 – 使用文章 ID来显示第一篇文章<br />
    * name=first-post – 使用 post Slug 显示第一篇文章<br />
    * page_id=7<br />
    * pagename=about<br />
    * showposts=1 (你可以使用 showposts=3,或者其它的任何数字显示一定数目的文章)</p>
<p>由于 模板层级方面的原因, home.php先执行了。这意味这你可以编写一个home.php，home.phh调用query_posts()重新得到一个特别的网页并且将那个网页设置为你的首页。没有任何插件或者hacks，你需要运行一个机制，并且显示和维护一个非博客的首页。</p>
<p>更有用的方法，可能是利用WP的网页功能并且为你的首页使用这个功能。你可以将”关于网页”设置为entry point或者设置为站点的末页。你可能执行一些更动态的步骤，设置一个自定义网页，显示最近的评论，文章，类别，存档。请看看下面的例子。<br />
时间参数</p>
<p>得到某个特别的时间段内发表的文章</p>
<p>    * hour=<br />
    * minute=<br />
    * second=<br />
    * day= – 一个月中的每一天; 显示，例如，十五号发表的所有文章。<br />
    * monthnum=<br />
    * year=</p>
<p>网页参数</p>
<p>    * paged=2 -显示使用”以前发表的文章”链接时，通常在网页2上显示的文章。</p>
<p>    * posts_per_page=10 -每个网页显示的文章数目；-1这个值，会显示所有的文章。</p>
<p>    * order=ASC -按时间顺序显示文章，以相反的顺序显示DESC（默认）</p>
<p>Offset 参数</p>
<p>你不能转移或者忽视一个或者更多的原始文章，这些文章一般是你的query同时使用offset参数收集到的。</p>
<p>下面的函数会显示（1）最近的5篇文章</p>
<p>query_posts(&#8217;showposts=5&#038;offset=1&#8242;);</p>
<p>根据参数排序</p>
<p>根据这个区给得到的文章排序</p>
<p>    * orderby=author<br />
    * orderby=date<br />
    * orderby=category<br />
    * orderby=title<br />
    * orderby=modified<br />
    * orderby=modified<br />
    * orderby=menu_order<br />
    * orderby=parent<br />
    * orderby=ID<br />
    * orderby=rand</p>
<p>同时考虑”ASC”或者的”DESC”的排序参数<br />
联合参数</p>
<p>你可能从上面的例子中注意到，你使用一个&#038;（&#038;符号）将参数组合在一起，像：</p>
<p>query_posts(&#8216;cat=3&#038;year=2004&#8242;);</p>
<p>类别13，关于当前月份显示在主页上的文章：</p>
<p>if (is_home())  {<br />
query_posts ($query_string . &#8216;&#038;cat=13&#038;monthnum=&#8217; . date(&#8216;n&#8217;,current_time(&#8216;timestamp&#8217;))); }</p>
<p>在2.3版本中，这个参数组合会返回属于类别1同时属于类别3的文章，只显示两篇（2）文章，根据标题，按降序排列：</p>
<p>query_posts(array(&#8216;category__and&#8217;=>array(1,3),&#8217;showposts&#8217;=>2,&#8217;orderby&#8217;=>title,&#8217;order&#8217;=>DESC));</p>
<p>在2.3和2.5版本中，你可能期待下面的内容，返回属于类别1并且标签为”苹果”的所有文章</p>
<p>query_posts(&#8216;cat=1&#038;tag=apples&#8217;);</p>
<p>一个bug阻止这个运行。请看看Ticket #5433，一个工作区要搜索几个使用+的标签</p>
<p>query_posts(&#8216;cat=1&#038;tag=apples+apples&#8217;);</p>
<p>对于先前的查询，这个会产生期待的结果。注意使用’cat=1&#038;tag=apples+oranges’能够产生期待的结果。<!--:--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/09/20/wordpress-query_posts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blog域名迁移之迁移wordpress</title>
		<link>http://www.result-search.com/sty/2009/07/26/blog%e5%9f%9f%e5%90%8d%e8%bf%81%e7%a7%bb%e4%b9%8b%e8%bf%81%e7%a7%bbwordpress.html</link>
		<comments>http://www.result-search.com/sty/2009/07/26/blog%e5%9f%9f%e5%90%8d%e8%bf%81%e7%a7%bb%e4%b9%8b%e8%bf%81%e7%a7%bbwordpress.html#comments</comments>
		<pubDate>Sun, 26 Jul 2009 10:14:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=977</guid>
		<description><![CDATA[迁移wordpress主要涉及到3步：
1、数据备份
如果服务器上装有phpmyadmin，可以直接导出一下。使用shell的朋友，可以用如下命令来备份数据：
mysqldump  -u dbuser -pdbpass -h  dbhost  dbname &#124; gzip &#62; backup.sql.gz
把相应位置的dbuser, dbpass, dbhost和dbname替换为数据库用户名、密码、数据库服务器以及要备份的库名。最后得到的backup.sql.gz，就是一份完整备份。
插一句，我把备份的文件解压一看，居然有12M之巨。如果10%是有效内容的话，我这4年已经写了1.2M字节，相当于60万汉字了。
2、配置Web服务器
在这里需要牢记一点：使用301跳转，而不要用默认的302（refer）。
配置Web服务器的目的是，将访问原有域名的请求引导到新的域名。301跳转是永久重定向，而302跳转是暂时重定向。前者对搜索引擎更为友好。
在nginx中做如下配置：
server {
listen   80;
server_name  oldhost.com www.oldhost.com newhost.com;
rewrite ^/(.*) http://www.newhost.com/$1 permanent;
}
server{
listen  80;
server_name  newhost.com;
……
}
第一段的配置是将oldhost.com,www.oldhost.com,newhost.com的请求都重定向到www.newhost.com 下面。而第二段是用www.newhost.com替换原有的www.oldhost.com，其他部分不用改变。注意到在使用rewrite时，加入了 permanent关键字，可以使nginx发送301重定向。
如果使用apache，配置也类似，在rewrite时可加入参数R=301。
保存之后重启web服务器，使配置生效。
3、修改数据库
这也是对wordpress进行迁移的最后一步。需要注意，在完成第二步之后，wordpress会暂时无法打开，原因大家可以自己考虑一下。如果觉得不太好，把这一步提到前面也可以。或者可以先修改好配置文件，等第三步完成了再重启web服务器。
修改数据库主要修改3部分，语句可以在phpmyadmin或者mysql命令行中进行，整理自此处。
（1）修改站点地址、主页地址：
UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ’siteurl’;
（2）修改文章中内部链接以及附件地址：
UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’);
（3）更新文章永久链接：
UPDATE wp_posts SET guid = replace(guid, ‘http://www.old-domain.com’,’http://www.new-domain.com’);
这三板斧一过，wordpress的迁移已经完成了。之后就从新域名打开网站，看看是否还有什么地方遗漏未能改掉。
BTW，如果原来域名有备案的话，可以在页面底部去掉。更换域名以后，就失效喽。
]]></description>
			<content:encoded><![CDATA[<p>迁移wordpress主要涉及到3步：</p>
<p><strong>1、数据备份</strong></p>
<p>如果服务器上装有phpmyadmin，可以直接导出一下。使用shell的朋友，可以用如下命令来备份数据：</p>
<blockquote><p>mysqldump  -u <em>dbuser</em> -p<em>dbpass</em> -h  <em>dbhost  dbname</em> | gzip &gt; backup.sql.gz</p></blockquote>
<p>把相应位置的dbuser, dbpass, dbhost和dbname替换为数据库用户名、密码、数据库服务器以及要备份的库名。最后得到的backup.sql.gz，就是一份完整备份。</p>
<p>插一句，我把备份的文件解压一看，居然有12M之巨。如果10%是有效内容的话，我这4年已经写了1.2M字节，相当于60万汉字了。</p>
<p><strong>2、配置Web服务器</strong></p>
<p>在这里需要牢记一点：<strong>使用301跳转，而不要用默认的302</strong>（<a title="rfc" href="http://www.ietf.org/rfc/rfc2616.txt" target="_blank">refer</a>）。</p>
<p>配置Web服务器的目的是，将访问原有域名的请求引导到新的域名。301跳转是永久重定向，而302跳转是暂时重定向。前者对搜索引擎更为友好。</p>
<p>在nginx中做如下配置：</p>
<blockquote><p>server {<br />
listen   80;<br />
server_name  oldhost.com www.oldhost.com newhost.com;<br />
rewrite ^/(.*) http://www.newhost.com/$1 <strong>permanent</strong>;<br />
}</p>
<p>server{<br />
listen  80;<br />
server_name  newhost.com;<br />
……<br />
}</p></blockquote>
<p>第一段的配置是将oldhost.com,www.oldhost.com,newhost.com的请求都重定向到www.newhost.com 下面。而第二段是用www.newhost.com替换原有的www.oldhost.com，其他部分不用改变。注意到在使用rewrite时，加入了 permanent关键字，可以使nginx发送301重定向。</p>
<p>如果使用apache，配置也类似，在rewrite时可加入参数R=301。</p>
<p>保存之后重启web服务器，使配置生效。</p>
<p><strong>3、修改数据库</strong></p>
<p>这也是对wordpress进行迁移的最后一步。需要注意，在完成第二步之后，wordpress会暂时无法打开，原因大家可以自己考虑一下。如果觉得不太好，把这一步提到前面也可以。或者可以先修改好配置文件，等第三步完成了再重启web服务器。</p>
<p>修改数据库主要修改3部分，语句可以在phpmyadmin或者mysql命令行中进行，整理自<a title="                       ,                     _/((            _.---. .'   `\          .'      `     ^ T=         /     \       .--'        |      /       )'-.        ; ,   &lt;__..-(   '-.)         \ \-.__)    ``--._)          '.'-.__.-.            '-...-'" href="http://www.benmao.com/archives/523" target="_blank">此处</a>。</p>
<p>（1）修改站点地址、主页地址：</p>
<blockquote><p>UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ’siteurl’;</p></blockquote>
<p>（2）修改文章中内部链接以及附件地址：</p>
<blockquote><p>UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’);</p></blockquote>
<p>（3）更新文章永久链接：</p>
<blockquote><p>UPDATE wp_posts SET guid = replace(guid, ‘http://www.old-domain.com’,’http://www.new-domain.com’);</p></blockquote>
<p>这三板斧一过，wordpress的迁移已经完成了。之后就从新域名打开网站，看看是否还有什么地方遗漏未能改掉。</p>
<p>BTW，如果原来域名有备案的话，可以在页面底部去掉。更换域名以后，就失效喽。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/26/blog%e5%9f%9f%e5%90%8d%e8%bf%81%e7%a7%bb%e4%b9%8b%e8%bf%81%e7%a7%bbwordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress help sheet,wordpress实用帮助小抄[持续更新中]</title>
		<link>http://www.result-search.com/sty/2009/07/23/wordpress-help-sheet.html</link>
		<comments>http://www.result-search.com/sty/2009/07/23/wordpress-help-sheet.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 10:17:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=970</guid>
		<description><![CDATA[get_post_custom()
Get all key/value data for the current post.
get_post_custom_keys()
Get a list of all key names for the current post.
get_post_custom_values($key)
Get the list of values for a particular key on the current post.
get_post_meta($post_id, $key, $single = false)
In WP 1.5 and beyond, this function returns the meta information without cache problems. The function requires the post id, the key, [...]]]></description>
			<content:encoded><![CDATA[<p><!--:en-->get_post_custom()<br />
Get all key/value data for the current post.<br />
get_post_custom_keys()<br />
Get a list of all key names for the current post.<br />
get_post_custom_values($key)<br />
Get the list of values for a particular key on the current post.<br />
get_post_meta($post_id, $key, $single = false)<br />
In WP 1.5 and beyond, this function returns the meta information without cache problems. The function requires the post id, the key, and if $single is set to TRUE, it returns only the first result (NOT as an array) for PHP use.</p>
<p>忘记admin密码，可以这样<br />
修改MD5密码为:”<span style="color: #008000;">5d41402abc4b2a76b9719d911017c592</span>″，然后使用“hello”登录<br />
得到的字符串，就是加密后的admin。在phpmyadmin里更新下admin帐号的密码为这个新的字段</p>
<p>获取图片地址：</p>
<p>$search = &#8216;/&lt;img[^\&gt;]*src=\&#8221;(.+?)\&#8221;.*\/&gt;/&#8217;;</p>
<p><span> </span>$img_arr = &#8221;;</p>
<p><span> </span></p>
<p><span> </span>if (preg_match_all($search, $content, $matches, PREG_SET_ORDER))</p>
<p><span> </span>{</p>
<p><span> </span>foreach ($matches as $match)</p>
<p><span> </span>{</p>
<p><span> </span>$img_arr[] = $match[1];</p>
<p><span> </span>$content = str_replace($match[0], &#8221;, $content);</p>
<p><span> </span>}</p>
<p><span> </span>}</p>
<p>wordpress迁移，数据库修改语句</p>
<p>UPDATE wp_options SET option_value = replace(option_value, &#8216;old&#8217;,'new&#8217;) WHERE option_name = &#8216;home&#8217; OR option_name = &#8217;siteurl&#8217;;</p>
<p>UPDATE wp_posts SET post_content = replace(post_content,&#8217;old&#8217;,'new&#8217;);</p>
<p>UPDATE wp_posts SET guid = replace(guid, &#8216;old&#8217;, &#8216;new&#8217;);<!--:--><!--:zh-->get_post_custom()<br />
Get all key/value data for the current post.<br />
get_post_custom_keys()<br />
Get a list of all key names for the current post.<br />
get_post_custom_values($key)<br />
Get the list of values for a particular key on the current post.<br />
get_post_meta($post_id, $key, $single = false)<br />
In WP 1.5 and beyond, this function returns the meta information without cache problems. The function requires the post id, the key, and if $single is set to TRUE, it returns only the first result (NOT as an array) for PHP use.</p>
<p>忘记admin密码，可以这样<br />
修改MD5密码为:”<span style="color: #008000;">5d41402abc4b2a76b9719d911017c592</span>″，然后使用“hello”登录<br />
得到的字符串，就是加密后的admin。在phpmyadmin里更新下admin帐号的密码为这个新的字段</p>
<p>获取图片地址：</p>
<p>$search = &#8216;/&lt;img[^\&gt;]*src=\&#8221;(.+?)\&#8221;.*\/&gt;/&#8217;;</p>
<p><span> </span>$img_arr = &#8221;;</p>
<p><span> </span></p>
<p><span> </span>if (preg_match_all($search, $content, $matches, PREG_SET_ORDER))</p>
<p><span> </span>{</p>
<p><span> </span>foreach ($matches as $match)</p>
<p><span> </span>{</p>
<p><span> </span>$img_arr[] = $match[1];</p>
<p><span> </span>$content = str_replace($match[0], &#8221;, $content);</p>
<p><span> </span>}</p>
<p><span> </span>}</p>
<p>wordpress迁移，数据库修改语句</p>
<p>UPDATE wp_options SET option_value = replace(option_value, &#8216;old&#8217;,'new&#8217;) WHERE option_name = &#8216;home&#8217; OR option_name = &#8217;siteurl&#8217;;</p>
<p>UPDATE wp_posts SET post_content = replace(post_content,&#8217;old&#8217;,'new&#8217;);</p>
<p>UPDATE wp_posts SET guid = replace(guid, &#8216;old&#8217;, &#8216;new&#8217;);</p>
<p>博客换地址后，解决You do not have sufficient permissions to access this page.的问题。</p>
<p><code>UPDATE `prefix_usermeta` SET `meta_key` = REPLACE( `meta_key` , 'wp_', 'prefix_' );</code></p>
<p><em>(Make sure you do backups first! Note that the quotes used for string and field name are different.)</em></p>
<p>In the options table, there is ‘wp_user_roles’, make sure you get that changed into ‘prefix_user_roles’.</p>
<p><code>UPDATE `prefix_options` SET `option_name` = 'prefix_user_roles' WHERE `option_name` ='wp_user_roles' AND `blog_id` =0;</code><!--:--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/23/wordpress-help-sheet.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress永久链接格式建议</title>
		<link>http://www.result-search.com/sty/2009/07/23/wordpress%e6%b0%b8%e4%b9%85%e9%93%be%e6%8e%a5%e6%a0%bc%e5%bc%8f%e5%bb%ba%e8%ae%ae.html</link>
		<comments>http://www.result-search.com/sty/2009/07/23/wordpress%e6%b0%b8%e4%b9%85%e9%93%be%e6%8e%a5%e6%a0%bc%e5%bc%8f%e5%bb%ba%e8%ae%ae.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 06:20:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=968</guid>
		<description><![CDATA[wordpress永久链接用什么格式比较好？
其实这个问题没有统一的答案，因为各有各的说法，如果一定要一个确切的答案，那么我就给出两个永久链接格式建议：

/html/%postname%.html
/html/y%year%/%post_id%_%postname%.html

首先我来说说第一种永久链接格式的好处：

路径比较浅，所有的post都在html目录下，有利于SEO；
结尾是html，当今后访问量急剧上升，可以使用cos-html-cache静态化，由于都是在目录html，静态化之后不至于搞乱wordpress本身程序目录；
个人blog，假设可以坚持10年，一天一篇日志，也不过3000多篇日志，所以即使静态化，html目录下也仅仅不到10000个文件，不足以影响磁盘I/O效率；

相比之下，第二种永久链接的格式的优点在于，即使一年上万日志的静态化文件也不至于影响到磁盘的I/O性能，缺点在于目录层次太深，对SEO稍微不 利。第二种链接格式中的y%year% 为啥要加字母前缀呢？目的是为了防止静态化之后和默认的归档链接冲突，你可以加前缀字母”y”,当然也可以是其他字母，也可以是后缀！
综上，若你是个人blog，完全可以用第一种wordpress永久链接格式，若是团队blog，考虑到今后的扩展，建议用第二种格式！
]]></description>
			<content:encoded><![CDATA[<p>wordpress永久链接用什么格式比较好？</p>
<p>其实这个问题没有统一的答案，因为各有各的说法，如果一定要一个确切的答案，那么我就给出两个永久链接格式建议：</p>
<ol>
<li>/html/%postname%.html</li>
<li>/html/y%year%/%post_id%_%postname%.html</li>
</ol>
<p>首先我来说说<strong>第一种</strong>永久链接格式的好处：</p>
<ol>
<li>路径比较浅，所有的post都在html目录下，有利于SEO；</li>
<li>结尾是html，当今后访问量急剧上升，可以使用<a href="http://www.storyday.com/tag/cos-html-cache">cos-html-cache</a>静态化，由于都是在目录html，静态化之后不至于搞乱wordpress本身程序目录；</li>
<li>个人blog，假设可以坚持10年，一天一篇日志，也不过3000多篇日志，所以即使静态化，html目录下也仅仅不到10000个文件，不足以影响磁盘I/O效率；</li>
</ol>
<p>相比之下，第二种永久链接的格式的优点在于，即使一年上万日志的静态化文件也不至于影响到磁盘的I/O性能，缺点在于目录层次太深，对SEO稍微不 利。第二种链接格式中的y%year% 为啥要加字母前缀呢？目的是为了防止静态化之后和默认的归档链接冲突，你可以加前缀字母”y”,当然也可以是其他字母，也可以是后缀！</p>
<p>综上，若你是个人blog，完全可以用第一种wordpress永久链接格式，若是团队blog，考虑到今后的扩展，建议用第二种格式！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/23/wordpress%e6%b0%b8%e4%b9%85%e9%93%be%e6%8e%a5%e6%a0%bc%e5%bc%8f%e5%bb%ba%e8%ae%ae.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Rewrite / Permalink内部过程分析</title>
		<link>http://www.result-search.com/sty/2009/07/23/wordpress-rewrite-permalink%e5%86%85%e9%83%a8%e8%bf%87%e7%a8%8b%e5%88%86%e6%9e%90.html</link>
		<comments>http://www.result-search.com/sty/2009/07/23/wordpress-rewrite-permalink%e5%86%85%e9%83%a8%e8%bf%87%e7%a8%8b%e5%88%86%e6%9e%90.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 05:46:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=967</guid>
		<description><![CDATA[本文说明WP 对URL rewrite并生成当前请求的过程. 实际内容并不复杂, 说的比较啰嗦啦&#8230;
关于Query Vars
这是Wordpress全部代码中最重要的变量,所谓的query vars是一系列变量集合. WP通过解析URL设定query vars, 并通过分析query vars值决定显示那些文章,设定标志位等.所谓标志位是WP_Query类中一系列$is_xxx形式布尔成员变量,所有的is_xxx()形式 template tag实际上都是返回$wp_query里对应成员变量值.  举例而言,如果当前页面是单篇文章, 则p这个Query Var(以下简称变量)值不为空.(在WP类里空的query var根本不存在,而WP_Query类里如果对应name的query var没有设置,$wp_query-&#62;query_vars['varname']被填充为空值), 如果当前为搜索页, s变量值则为搜索关键字. 如果p和page两个变量都不为空值, 则当前为单篇文章分页页面, 依次类推. Query Vars在WP类($wp)里根据WP_Rewrite里的rewrite规则生成, 在WP_Query($wp_query)类里这些变量被用来建立主循环.
WP和WP_Query类里都有query_vars成员变量,键值为query vars里的varname. 具体的query vars包括&#8217;m', &#8216;p&#8217;, &#8216;posts&#8217;, &#8216;w&#8217;, &#8216;cat&#8217;, &#8216;withcomments&#8217;, &#8216;withoutcomments&#8217;, &#8217;s&#8217;, &#8217;search&#8217;, &#8216;exact&#8217;, &#8217;sentence&#8217;, &#8216;debug&#8217;, &#8216;calendar&#8217;, &#8216;page&#8217;, &#8216;paged&#8217;, &#8216;more&#8217;, &#8216;tb&#8217;, &#8216;pb&#8217;, &#8216;author&#8217;, &#8216;order&#8217;, &#8216;orderby&#8217;, &#8216;year&#8217;, &#8216;monthnum&#8217;, &#8216;day&#8217;, &#8216;hour&#8217;, &#8216;minute&#8217;, &#8217;second&#8217;, &#8216;name&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<p>本文说明WP 对URL rewrite并生成当前请求的过程. 实际内容并不复杂, 说的比较啰嗦啦&#8230;</p>
<p>关于Query Vars<br />
这是Wordpress全部代码中最重要的变量,所谓的query vars是一系列变量集合. WP通过解析URL设定query vars, 并通过分析query vars值决定显示那些文章,设定标志位等.所谓标志位是WP_Query类中一系列$is_xxx形式布尔成员变量,所有的is_xxx()形式 template tag实际上都是返回$wp_query里对应成员变量值.  举例而言,如果当前页面是单篇文章, 则p这个Query Var(以下简称变量)值不为空.(在WP类里空的query var根本不存在,而WP_Query类里如果对应name的query var没有设置,$wp_query-&gt;query_vars['varname']被填充为空值), 如果当前为搜索页, s变量值则为搜索关键字. 如果p和page两个变量都不为空值, 则当前为单篇文章分页页面, 依次类推. Query Vars在WP类($wp)里根据WP_Rewrite里的rewrite规则生成, 在WP_Query($wp_query)类里这些变量被用来建立主循环.</p>
<p>WP和WP_Query类里都有query_vars成员变量,键值为query vars里的varname. 具体的query vars包括&#8217;m', &#8216;p&#8217;, &#8216;posts&#8217;, &#8216;w&#8217;, &#8216;cat&#8217;, &#8216;withcomments&#8217;, &#8216;withoutcomments&#8217;, &#8217;s&#8217;, &#8217;search&#8217;, &#8216;exact&#8217;, &#8217;sentence&#8217;, &#8216;debug&#8217;, &#8216;calendar&#8217;, &#8216;page&#8217;, &#8216;paged&#8217;, &#8216;more&#8217;, &#8216;tb&#8217;, &#8216;pb&#8217;, &#8216;author&#8217;, &#8216;order&#8217;, &#8216;orderby&#8217;, &#8216;year&#8217;, &#8216;monthnum&#8217;, &#8216;day&#8217;, &#8216;hour&#8217;, &#8216;minute&#8217;, &#8217;second&#8217;, &#8216;name&#8217;, &#8216;category_name&#8217;, &#8216;tag&#8217;, &#8216;feed&#8217;, &#8216;author_name&#8217;, &#8217;static&#8217;, &#8216;pagename&#8217;, &#8216;page_id&#8217;, &#8216;error&#8217;, &#8216;comments_popup&#8217;, &#8216;attachment&#8217;, &#8216;attachment_id&#8217;, &#8217;subpost&#8217;, &#8217;subpost_id&#8217;, &#8216;preview&#8217;, &#8216;robots&#8217;, &#8216;taxonomy&#8217;, &#8216;term&#8217;, &#8216;cpage&#8217;等公开变量,以及一些private变量. private变量不能由rewrite/GET等方式生成, 所以我们这里说的都指公开变量(public query vars)</p>
<p>准备知识:WP初始化过程:<br />
基本过程是index.php  -&gt;wp-blog.header.php -&gt;wp-load.php .</p>
<p>通过wp-load.php 先后包含了wp-config.php, wp-setting.php,classes.php,fucntions.php query.php等文件,并建立了三个全局变量,$wp_the_query,$wp_rewrite和$wp ,分别为WP_Query,WP_Rewrite和WP类的实例,另外建立了一个$wp_query=&amp;$wp_the_query, (之所以这样做是为了通过query_posts等方式新建自定义查询时不会损坏WP主循环,在自定义查询结束后可以调用wp_reset_query 把$wp_query还原为$wp_the-query引用). 然后,wp-blog-header执行wp()函数,并通过其调用$wp所属WP类的main方法,这个方法又调用一系列方法,但最重要的是 parse_request方法, WP从这里开始解析URL并建立主循环.</p>
<p>我们假设使用了友好的permalink,并且通过Apache下.htaccess实现. 那么 ,WP类的parse_request方法建立一个$request变量,这个变量值是$_SERVER['REUEST_URI'] 或$_SERVER['PATH_INFO']经过处理后的值, 是request_uri还是path_info取决于当前是否URL是否pathinfo类型请求. 处理过程包括,移除request_uri和path_info里?以后部分(即所有GET参数). 去除request url开始的/ ,  如果你WP安装在子目录(如wordpress/目录), 从(request_uri和pathinfo)开头去除wordpress/ , 去除末尾的&#8217;/&#8217; , 对request_uri进行rawurldecode等. ($_SERVER['PATH_INFO']的值已经是decode过的了,所以无需由wp处理).当一切完成后, $request就是一个规范化的当前请求filename, 形如 post-slug, date/YYYY/mm, tag/tag-slug之类 , 接下来,WP根据rewrite规则逐条对$request进行匹配(preg_match), 如果找到一个匹配, 建立相关的变量(query vars);如果没有任何匹配,则为404</p>
<p>所谓的Rewrite规则就是关联数组, 键值为用来匹配$request的正则表达式, 值为解析的变量, 如&#8217;([0-9]+)(/[0-9]+)?/?$&#8217; =&gt; &#8216;index.php?p=$matches[1]&amp;page=$matches[2]&#8216; 就是一条规则. 具体解析过程稍后会有介绍.在WP类里会调用$wp_rewrite的wp_rewrite_rules方法获取rewrite规则.注意Rewrite 规则有缓存的, 保存在数据库wp_option表,option name为rewrite_rules.如果数据库里这个option值为空,wp_rewrite_rules()会根据你的permalink structure重新生成rewrite规则, 并保存到数据库中.在后台更改永久链接结构时也会重新生成rewrite规则并保存到数据库中.</p>
<p>具体的过程,举例说明,如果你使用了 /%post_id% 形式的permalink, 当前URL是 <a href="http://domain.com/18." target="_blank">http://domain.com/18.</a> 解析出来的$request则是18 . WP对rewrite数组里每条规则$match用preg_match(&#8220;!^$match!&#8221;, $request, $matches)语句尝试匹配, 发现$request与 &#8216;([0-9]+)(/[0-9]+)?/?$&#8217; =&gt; &#8216;index.php?p=$matches[1]&amp;page=$matches[2]&#8216; 这条规则匹配, preg_match把 &#8216;18&#8242; 和空值保存到$matches数组里, 然后WP提取出匹配项值?后部分&#8217;p=$matches[1]&amp;page=$matches[2]&#8216;,对这个字符串$query执行 eval(&#8220;@\$query = \&#8221;" . addslashes($query) . &#8220;\&#8221;;&#8221;);语句, 这句的目的是把$matches[1]替换为18, 把 $matches[2]替换为空. 所以$query值变为&#8217;p=671&amp;page=&#8217;, 然后执行parse_str($query, $perma_query_vars); 这样现在$perma_query_vars数组里就有键值&#8217;为p&#8217;和&#8217;page&#8217;的值.  但这还不是最终的query vars, 最终生成的query vars是$GLOBALS, $_POST, $GET和$perma_query_vars里键值为变量名项集合.依次判断. 如果 $_POST['varname']存在,则varname这个query var值为$_POST['varname'], 而不再继续判断$_GET['varname']和$perma_query_vars['varname']是否存在, 如此类推. 最后生成的query vars保存在 $wp-&gt;query_vars里.</p>
<p>如果使用的是默认的/?p=123 permalink形式,那么上面过程简单的多,只会从$GLOBALS, $_POST, $GET里提取query vars变量值,而不会解析REQUEST_URI和PATH_INFO.</p>
<p>上面过程完成后会执行parse_request这个Action,然后执行$wp的query_posts方法,这个方法 把$wp-&gt;query_vars传给$wp_the_query的query方法,开始建立主循环,设定标志位(is_home, is_page &#8230;)等.接下来就是载入模板显示页面内容了.</p>
<p>下面分析一些问题:<br />
1. 假设permalink设置为/%post_id%, 数据库中有id为 10和11的两篇文章, 访问<a href="http://domain.com/10/?p=11" target="_blank">http://domain.com/10/?p=11</a> ,显示什么内容?- -<br />
答案是会显示id为11的文章,因为上面说的, $_GET里变量优先级高于rewrite rules里解析出来的变量($perma_query_vars),所以最后的p变量值为11.但这时WP通常会把当前页重定向到<a href="http://domain.com/11" target="_blank">http://domain.com/11</a>, 因为WP有canoninol机制(wp-includes/canonical.php),能够301重定向一些不规范地址到规范url, 典型的如把其他域名重定向到后台HOME和SITEURL里设定的域名里页面.但WP的canonical机制并不完善, 个人推荐使用permalink validator插件,这个插件判断当前URL与官方URL是否完全匹配,如果不匹配要么重定向,要么set 404,..</p>
<p>2. 假设permalink设置为/%post_name%, 访问<a href="http://domain.com/index.php/%post_name%" target="_blank">http://domain.com/index.php/%post_name%</a>结果如何?<br />
如果对应slug的post存在的话, 不会是404. 因为虽然你permalink没有设置为index.php形式的path info permalink,但如上面所说,WP在解析URL时并不判断后台设定的永久链接结构是path info还是request uri类型或者甚至是默认/?p=123类型. 不过这时通常会重定向到<a href="http://domain.com/%post_name%" target="_blank">http://domain.com/%post_name%</a> , 同样因为canonical机制.</p>
<p>3. 关于URL末尾的 &#8216;/&#8217;<br />
URL末尾是否有/对rewrite没有影响, 如上所述, WP类在生成$request时会去除requset_uri和path_info末尾/ ,另外,你注意到所有WP生成的rewrite规则, 键值正则式的末尾均为  /?$ ,表示URL末尾可选 / .  不过wp会判断当前URL末尾是否有/ 以及后台设置的permalink末尾是否有/, 如果不一致则301重定向, 还是因为canonical代码. 请注意WP的 canonical代码在template_redirect这个action处执行,这时WP实际上已经解析完query vars, 主循环也设置好了, 即将载入模板..</p>
<p>4. 假设permalink设置为/%post_name%,数据库里两个有slug都为&#8217;about&#8217;的post和page,访问<a href="http://domain.com/about" target="_blank">http://domain.com/about</a>, 显示哪个?<br />
这种情况由rewrite规则数组顺序决定, 通常wp生成的rewrite规则里 &#8216;(.+?)(/[0-9]+)?/?$&#8217; =&gt; &#8216;index.php?pagename=$matches[1]&amp;page=$matches[2]&#8216; 这条规则是最后一个, 所以这时会显示post而不是page.</p>
<p>5. 有人使用&#8221;古怪&#8221;的permalink结构,如/?p=%post_id%.html, 然后发现所有分类/tag页全部显示最新文章= =<br />
原因是在这种古怪的permalink结构下,WP根本无法正确获取query vars变量,无论从GET还是url rewrite,因为如上面所说,wp rewrite 的第一步就是去除request_uri和path_info里?以后部分.事实上在这种情况下单篇文章页能够正常显示也仅仅因为有一个通过GET传递的 p变量,值为 18.html这样形式,然后php 的 (int) 或intval() 把它变成了18 = =</p>
<p>6 .关于Verbose rewrite<br />
以Apache为例,wp默认生成的.htaccess里mod_rewrite规则非常简单:</p>
<div class="blockcode">
<div id="code0">
<ol>
<li># BEGIN WordPress</li>
<li>&lt;IfModule mod_rewrite.c&gt;</li>
<li>RewriteEngine On</li>
<li>RewriteBase /</li>
<li>RewriteCond %{REQUEST_FILENAME} !-f</li>
<li>RewriteCond %{REQUEST_FILENAME} !-d</li>
<li>RewriteRule . /index.php [L]</li>
<li>&lt;/IfModule&gt;</li>
<li></li>
<li># END WordPress</li>
</ol>
</div>
<p><em onclick="copycode($('code0'));">复制代码</em></div>
<p>如 果当前请求不为文件或目录,把URL请求里第一个字符重写到index.php并停止继续rewrite.然后WP会通过request_uri或 path_info解析query vars, 如上面所述.  WP还提供一种non verbose rewrite rules, 但并没有提供前台接口. 在wp-include/rewrite.php里把WP_Rewrite里var $use_verbose_rules = true; 这句赋值改为false, 后台重新保存一下permalink,你会发现.htaccess里内容已经变了:</p>
<div class="blockcode">
<div id="code1">
<ol>
<li># BEGIN WordPress</li>
<li>&lt;IfModule mod_rewrite.c&gt;</li>
<li>RewriteEngine On</li>
<li>RewriteBase /</li>
<li>RewriteCond %{REQUEST_FILENAME} -f [OR]</li>
<li>RewriteCond %{REQUEST_FILENAME} -d</li>
<li>RewriteRule ^robots\.txt$ /index.php?robots=1 [QSA,L]</li>
<li>RewriteRule ^.*wp-atom.php$ /index.php?feed=atom [QSA,L]</li>
<li>RewriteRule ^.*wp-rdf.php$ /index.php?feed=rdf [QSA,L]</li>
<li>RewriteRule ^.*wp-rss.php$ /index.php?feed=rss [QSA,L]</li>
<li>RewriteRule ^.*wp-rss2.php$ /index.php?feed=rss2 [QSA,L]</li>
<li>RewriteRule ^.*wp-feed.php$ /index.php?feed=feed [QSA,L]</li>
<li>RewriteRule ^.*wp-commentsrss2.php$ /index.php?feed=rss2&amp;withcomments=1 [QSA,L]</li>
<li>RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?&amp;feed=$1 [QSA,L]</li>
<li>RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /index.php?&amp;feed=$1 [QSA,L]</li>
<li>&#8230;..</li>
<li>RewriteRule ^(.+)/page/?([0-9]{1,})/?$ /index.php?pagename=$1&amp;paged=$2 [QSA,L]</li>
<li>RewriteRule ^(.+)/comment-page-([0-9]{1,})/?$ /index.php?pagename=$1&amp;cpage=$2 [QSA,L]</li>
<li>RewriteRule ^(.+)(/[0-9]+)?/?$ /index.php?pagename=$1&amp;page=$2 [QSA,L]</li>
<li>&lt;/IfModule&gt;</li>
<li></li>
<li># END WordPress</li>
</ol>
</div>
</div>
<p>你 可能对这种rewrite规则更为熟悉,国内的程序基本上都是用这种Rewrite. 请注意这时WP的内部过程完全不同. 在这种情况下, WP 的query vars值均来源于$_GET (Apache直接rewrite生成的), 但Request_uri或Path_Info仍会被解析并且生成的$perma_query_vars完全正确,! 只是不会被用于query vars而已. 因为$_GET优先级高于对url rewrite获得的值. 有人在windows下IIS的httpd.ini里加入rewrite规则,后台permalink设置为默认后rewrite后友好地址仍可以访问, 就是这个原因.</p>
<p>如果你能看懂(或早已知道)上面内容, 那么, 我相信对所有关于Wordpress rewrite/permalink方面的问题,你都能够解决,或者至少找到思路.至少,我是这样的.XT.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/23/wordpress-rewrite-permalink%e5%86%85%e9%83%a8%e8%bf%87%e7%a8%8b%e5%88%86%e6%9e%90.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress教程：PHP文件编辑器</title>
		<link>http://www.result-search.com/sty/2009/07/20/wordpress%e6%95%99%e7%a8%8b%ef%bc%9aphp%e6%96%87%e4%bb%b6%e7%bc%96%e8%be%91%e5%99%a8.html</link>
		<comments>http://www.result-search.com/sty/2009/07/20/wordpress%e6%95%99%e7%a8%8b%ef%bc%9aphp%e6%96%87%e4%bb%b6%e7%bc%96%e8%be%91%e5%99%a8.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 23:23:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=924</guid>
		<description><![CDATA[使用WordPress，很多朋友都会在主题的选择上花大量的时间，我比较认可的一种方式是，选择一款主题，进行适当的修改。从这篇文章开始，我将 陆续介绍对WordPress主题进行修改需要的软件，并且对官方默认的主题进行分析，让大家能通过主题的修改，来完善自己的主题，达到满意的效果。这里需要强调一点，不管对主题修改到什么地步，只要主题不是原创的，请加上版权说明。
可以PHP文件编辑器很多，我介绍的，是基于我自己的使用。
我使用的PHP文件编辑器是Editplus，这个编辑器最大的特点是在编辑PHP文件并保存后，会生成一个针对未编辑前文件的备份文件，以.BAK结 尾。这样的好处是显而易见的，如果对PHP文件的修改失败，可以直接对备份进行还原，修改。EditPlu是一套功能强大，可取代记事本的文字编辑器，拥 有无限制的撤消与重做、自动换行、英文拼字检查、搜寻取代、列数标记、同时编辑多文件、全屏幕浏览功能。能够同步于剪贴板自动将文字粘贴进 EditPlus 的编辑窗口中，让你省去粘贴的步骤，而它还有一个好用的功能，就是它有监视剪贴板的功能！
还有很多的功能，可以在使用的过程中去了解，熟悉。软件已经发布第三个版本，我个人使用的是绿色版的。
绿色版地址链接：Editplus
绿色版下载地址失效了，可能是在调整，所以我还保留了链接地址，大家可以www.g.cn下载该软件。
]]></description>
			<content:encoded><![CDATA[<p>使用WordPress，很多朋友都会在主题的选择上花大量的时间，我比较认可的一种方式是，选择一款主题，进行适当的修改。从这篇文章开始，我将 陆续介绍对WordPress主题进行修改需要的软件，并且对官方默认的主题进行分析，让大家能通过主题的修改，来完善自己的主题，达到满意的效果。<strong>这里需要强调一点，不管对主题修改到什么地步，只要主题不是原创的，请加上版权说明。</strong><br />
可以PHP文件编辑器很多，我介绍的，是基于我自己的使用。<br />
我使用的PHP文件编辑器是Editplus，这个编辑器最大的特点是在编辑PHP文件并保存后，会生成一个针对未编辑前文件的备份文件，以.BAK结 尾。这样的好处是显而易见的，如果对PHP文件的修改失败，可以直接对备份进行还原，修改。EditPlu是一套功能强大，可取代记事本的文字编辑器，拥 有无限制的撤消与重做、自动换行、英文拼字检查、搜寻取代、列数标记、同时编辑多文件、全屏幕浏览功能。能够同步于剪贴板自动将文字粘贴进 EditPlus 的编辑窗口中，让你省去粘贴的步骤，而它还有一个好用的功能，就是它有监视剪贴板的功能！<br />
还有很多的功能，可以在使用的过程中去了解，熟悉。软件已经发布第三个版本，我个人使用的是绿色版的。<br />
绿色版地址链接：<a href="http://www.downkr.com/soft/1402.html" target="_blank">Editplus</a></p>
<p>绿色版下载地址失效了，可能是在调整，所以我还保留了链接地址，大家可以www.g.cn下载该软件。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/20/wordpress%e6%95%99%e7%a8%8b%ef%bc%9aphp%e6%96%87%e4%bb%b6%e7%bc%96%e8%be%91%e5%99%a8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10件安装WordPress后需要做的事</title>
		<link>http://www.result-search.com/sty/2009/07/20/10%e4%bb%b6%e5%ae%89%e8%a3%85wordpress%e5%90%8e%e9%9c%80%e8%a6%81%e5%81%9a%e7%9a%84%e4%ba%8b.html</link>
		<comments>http://www.result-search.com/sty/2009/07/20/10%e4%bb%b6%e5%ae%89%e8%a3%85wordpress%e5%90%8e%e9%9c%80%e8%a6%81%e5%81%9a%e7%9a%84%e4%ba%8b.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 13:36:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=923</guid>
		<description><![CDATA[这又是一篇介绍安装WordPress之后需要做的事情，这是一个系列教程，Wopus系统能通过这个教程让各位菜鸟能学到东西，各位在看教程的过程中有任何疑问，欢迎留言。
一、预防垃圾留言
不知道从什么时候开始，博客成为了大家做广告绝好的地方，垃圾留言滚滚而来，而WordPress又是出了名的对搜索引擎很友好的程序，加上很多朋友不知道nofollow，所以，大家就开始和垃圾留言做斗争了。
默认的反垃圾程序Akismet需要一个API KEY，这样可以共享一个反垃圾的数据库，但这个KEY需要在WordPress.com注册，当然，这个网站在有些时候是无法打开的，但这个插件确实需要一个KEY才有用，所以大家在安装WordPress之后，需要先注册这，获得一个API KEY，其实这个KEY是可以共享的，所以，找相熟的朋友分享一个就OK。
目前位置，我见过的拦截垃圾留言最的博客是百万级的，一个博客，有这么多垃圾留言，不容易！
二、更改博客的永久链接形式
WordPress安装成功之后，默认的永久链接形式：http://xxx.com/?p=xxx，这种永久链接形式对搜索引擎并不友好。做好的链接形式很多人都认为是自定义的伪静态链接，而且现在绝大多数的博客都是在使用这种永久链接形式，所以也就推荐给大家，这里有伪静态链接形式的详细说明，点击查看。
这里需要说明一下，请确定，使用的空间是支持伪静态的，(mod_rewriter。)
(既然说到了伪静态，这里就多说几句吧，希望能大家能有一点帮助。当伪静态链接很少被大家使用的时候，这种链接形式确实很受搜索引擎青睐，但当所有的都是伪静态的时候，搜索引擎就不喜欢了，就说到这里，其他的大家自己去想吧。)
三、改进WordPress缓存
随着WP的不断更新，不记得从哪个版本开始了，或者从WordPress被大家使用以来就开始了，都说WordPress的执行效率低，所以改善执行效率就是一个很大很大的事情，所以就有了缓存插件，这里不具体介绍缓存插件，但可以明确一点，缓存插件确实有用。
四、创建博客地图
方便搜索引擎的抓取，这个非常必要，通常，大家都使用这个插件：Google XML Sitemap。
五、给博客烧录Feed
修改博客默认的feed地址，尽量托管到第三方。当前比较注明的有Feedburner、Friendfeed、国内的Feedsky。
六、增加统计代码
国内的统计有很多，一般的博客用cnzz和51啦就ok，还有量子恒道，当然还有就是大仙：Google统计，至于为啥要加统计代码，相信各位都清楚。
七、提交博客到相关网站
除了以上的苦练“内功“之外，也要积极的把博客推广出去，向各个搜索引擎提交是很必须的。
八、创建 robots.txt
关于这点，推荐Wopus以前的两篇文章：搜索引擎统一：Robots文件标准、Wordpress搜索引擎优化之robots.txt优化。
九、找一款好的主题
看人，第一印象太重要了，博客也是，所以安装好博客之后，尽快找到一款好的WordPress主题，也是很关键的，当然，有爱好的朋友，可以自己设计。
十、开始好好写内容吧
再好的设置，再好的优化，再好的主题，再好的用户体验，都需要有好的内容来支持，所以，内容才是王道！
当然，记得把自己好好通过about页面好好介绍一番，这个方便交流和沟通，也是很必须的。
一个WordPress做好以上十点，足能做好一个好的博客。各位不要只看，更要动手做。另外，欢迎各位分享经验。
]]></description>
			<content:encoded><![CDATA[<p>这又是一篇介绍安装WordPress之后需要做的事情，这是一个系列教程，Wopus系统能通过这个教程让各位菜鸟能学到东西，各位在看教程的过程中有任何疑问，欢迎留言。</p>
<p>一、预防垃圾留言<br />
不知道从什么时候开始，博客成为了大家做广告绝好的地方，垃圾留言滚滚而来，而WordPress又是出了名的对搜索引擎很友好的程序，加上很多朋友不知道nofollow，所以，大家就开始和垃圾留言做斗争了。</p>
<p>默认的反垃圾程序Akismet需要一个API KEY，这样可以共享一个反垃圾的数据库，但这个KEY需要在WordPress.com注册，当然，这个网站在有些时候是无法打开的，但这个插件确实需要一个KEY才有用，所以大家在安装WordPress之后，需要先注册这，获得一个API KEY，其实这个KEY是可以共享的，所以，找相熟的朋友分享一个就OK。</p>
<p>目前位置，我见过的拦截垃圾留言最的博客是百万级的，一个博客，有这么多垃圾留言，不容易！</p>
<p>二、更改博客的永久链接形式<br />
WordPress安装成功之后，默认的永久链接形式：http://xxx.com/?p=xxx，这种永久链接形式对搜索引擎并不友好。做好的链接形式很多人都认为是自定义的伪静态链接，而且现在绝大多数的博客都是在使用这种永久链接形式，所以也就推荐给大家，这里有伪静态链接形式的详细说明，点击查看。</p>
<p>这里需要说明一下，请确定，使用的空间是支持伪静态的，(mod_rewriter。)</p>
<p>(既然说到了伪静态，这里就多说几句吧，希望能大家能有一点帮助。当伪静态链接很少被大家使用的时候，这种链接形式确实很受搜索引擎青睐，但当所有的都是伪静态的时候，搜索引擎就不喜欢了，就说到这里，其他的大家自己去想吧。)</p>
<p>三、改进WordPress缓存<br />
随着WP的不断更新，不记得从哪个版本开始了，或者从WordPress被大家使用以来就开始了，都说WordPress的执行效率低，所以改善执行效率就是一个很大很大的事情，所以就有了缓存插件，这里不具体介绍缓存插件，但可以明确一点，缓存插件确实有用。</p>
<p>四、创建博客地图<br />
方便搜索引擎的抓取，这个非常必要，通常，大家都使用这个插件：Google XML Sitemap。</p>
<p>五、给博客烧录Feed<br />
修改博客默认的feed地址，尽量托管到第三方。当前比较注明的有Feedburner、Friendfeed、国内的Feedsky。</p>
<p>六、增加统计代码<br />
国内的统计有很多，一般的博客用cnzz和51啦就ok，还有量子恒道，当然还有就是大仙：Google统计，至于为啥要加统计代码，相信各位都清楚。</p>
<p>七、提交博客到相关网站<br />
除了以上的苦练“内功“之外，也要积极的把博客推广出去，向各个搜索引擎提交是很必须的。</p>
<p>八、创建 robots.txt<br />
关于这点，推荐Wopus以前的两篇文章：搜索引擎统一：Robots文件标准、Wordpress搜索引擎优化之robots.txt优化。</p>
<p>九、找一款好的主题<br />
看人，第一印象太重要了，博客也是，所以安装好博客之后，尽快找到一款好的WordPress主题，也是很关键的，当然，有爱好的朋友，可以自己设计。</p>
<p>十、开始好好写内容吧<br />
再好的设置，再好的优化，再好的主题，再好的用户体验，都需要有好的内容来支持，所以，内容才是王道！<br />
当然，记得把自己好好通过about页面好好介绍一番，这个方便交流和沟通，也是很必须的。</p>
<p>一个WordPress做好以上十点，足能做好一个好的博客。各位不要只看，更要动手做。另外，欢迎各位分享经验。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/20/10%e4%bb%b6%e5%ae%89%e8%a3%85wordpress%e5%90%8e%e9%9c%80%e8%a6%81%e5%81%9a%e7%9a%84%e4%ba%8b.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>提高博客流量的一点小技巧</title>
		<link>http://www.result-search.com/sty/2009/07/20/%e6%8f%90%e9%ab%98%e5%8d%9a%e5%ae%a2%e6%b5%81%e9%87%8f%e7%9a%84%e4%b8%80%e7%82%b9%e5%b0%8f%e6%8a%80%e5%b7%a7.html</link>
		<comments>http://www.result-search.com/sty/2009/07/20/%e6%8f%90%e9%ab%98%e5%8d%9a%e5%ae%a2%e6%b5%81%e9%87%8f%e7%9a%84%e4%b8%80%e7%82%b9%e5%b0%8f%e6%8a%80%e5%b7%a7.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 13:34:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=922</guid>
		<description><![CDATA[在Wordpress的管理员控制面版中，转到选项，选择Writing。在页面底部，你会看到标有“Update Services”的大文本框。这个功能可以通知更新服务商你在博客上发布了新的内容。在这些网站上保持博客帖子的更新，有助于提高网站流量，而且对seo也是用一定的好处的。
下面是一些常用的更新服务商的地址，把这些地址复制到Update Services的文本框里，保存就可以了。
中文博客：
http://blogsearch.google.com/ping/RPC2
http://www.xianguo.com/xmlrpc/ping.php
http://www.zhuaxia.com/rpc/server.php
http://blog.youdao.com/ping/RPC2
http://www.feedsky.com/api/RPC2
英文博客：
http://api.moreover.com/RPC2
http://bblog.com/ping.php
http://blogsearch.google.com/ping/RPC2
http://ping.weblogalot.com/rpc.php
http://ping.feedburner.com
http://ping.syndic8.com/xmlrpc.php
http://ping.bloggers.jp/rpc/
http://rpc.pingomatic.com/
http://rpc.weblogs.com/RPC2
http://rpc.technorati.com/rpc/ping
http://topicexchange.com/RPC2
http://www.blogpeople.net/servlet/weblogUpdates
http://xping.pubsub.com/ping
这也是WordPress为何对搜索引擎如此友好的一个重要原因。
]]></description>
			<content:encoded><![CDATA[<p>在Wordpress的管理员控制面版中，转到选项，选择Writing。在页面底部，你会看到标有“Update Services”的大文本框。这个功能可以通知更新服务商你在博客上发布了新的内容。在这些网站上保持博客帖子的更新，有助于提高网站流量，而且对seo也是用一定的好处的。</p>
<p>下面是一些常用的更新服务商的地址，把这些地址复制到Update Services的文本框里，保存就可以了。</p>
<p>中文博客：</p>
<p>http://blogsearch.google.com/ping/RPC2</p>
<p>http://www.xianguo.com/xmlrpc/ping.php</p>
<p>http://www.zhuaxia.com/rpc/server.php</p>
<p>http://blog.youdao.com/ping/RPC2</p>
<p>http://www.feedsky.com/api/RPC2</p>
<p>英文博客：</p>
<p>http://api.moreover.com/RPC2</p>
<p>http://bblog.com/ping.php</p>
<p>http://blogsearch.google.com/ping/RPC2</p>
<p>http://ping.weblogalot.com/rpc.php</p>
<p>http://ping.feedburner.com</p>
<p>http://ping.syndic8.com/xmlrpc.php</p>
<p>http://ping.bloggers.jp/rpc/</p>
<p>http://rpc.pingomatic.com/</p>
<p>http://rpc.weblogs.com/RPC2</p>
<p>http://rpc.technorati.com/rpc/ping</p>
<p>http://topicexchange.com/RPC2</p>
<p>http://www.blogpeople.net/servlet/weblogUpdates</p>
<p>http://xping.pubsub.com/ping</p>
<p>这也是WordPress为何对搜索引擎如此友好的一个重要原因。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/20/%e6%8f%90%e9%ab%98%e5%8d%9a%e5%ae%a2%e6%b5%81%e9%87%8f%e7%9a%84%e4%b8%80%e7%82%b9%e5%b0%8f%e6%8a%80%e5%b7%a7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>给WP添加Ctrl+Enter回复快捷键</title>
		<link>http://www.result-search.com/sty/2009/07/20/%e7%bb%99wp%e6%b7%bb%e5%8a%a0ctrlenter%e5%9b%9e%e5%a4%8d%e5%bf%ab%e6%8d%b7%e9%94%ae.html</link>
		<comments>http://www.result-search.com/sty/2009/07/20/%e7%bb%99wp%e6%b7%bb%e5%8a%a0ctrlenter%e5%9b%9e%e5%a4%8d%e5%bf%ab%e6%8d%b7%e9%94%ae.html#comments</comments>
		<pubDate>Mon, 20 Jul 2009 13:24:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://www.yaaahaaa.com/?p=921</guid>
		<description><![CDATA[经常逛论坛的人一般都习惯评论完后直接按 Ctrl+Enter 提交评论，使用 QQ 聊天时也是这样，打完字随手按下快捷键搞定，其实在 Wordpress的 comments.php 里 < ?php endif; ?>后插入如下 JS 代码也可以给留言板实现这个功能：
script type=&#8221;text/javascript&#8221;>
document.getElementById(&#8220;comment&#8221;).onkeydown = function (moz_ev)
{
var ev = null;
if (window.event){
ev = window.event;
}else{
ev = moz_ev;
}
if (ev != null &#038;&#038; ev.ctrlKey &#038;&#038; ev.keyCode == 13)
{
document.getElementById(&#8220;submit&#8221;).click();
}
}
然后继续在 comments.php 文件中找到下面这句：
将 value=&#8221;Submit&#8221;（不同的主题可能会有些差别，其实就是提交的那个按扭）的 value 值里加上一个(Ctrl+Enter)，改成 value=&#8221;Submit(Ctrl+Enter)&#8221;
方法二：(万戈)
　在 comments.php 中找到以下代码：
修改为：
总结：相比来说，第二种方法更简单，却实现了相同的效果。
]]></description>
			<content:encoded><![CDATA[<p>经常逛论坛的人一般都习惯评论完后直接按 Ctrl+Enter 提交评论，使用 QQ 聊天时也是这样，打完字随手按下快捷键搞定，其实在 Wordpress的 comments.php 里 < ?php endif; ?>后插入如下 JS 代码也可以给留言板实现这个功能：</p>
<p>script type=&#8221;text/javascript&#8221;><br />
document.getElementById(&#8220;comment&#8221;).onkeydown = function (moz_ev)<br />
{<br />
var ev = null;<br />
if (window.event){<br />
ev = window.event;<br />
}else{<br />
ev = moz_ev;<br />
}<br />
if (ev != null &#038;&#038; ev.ctrlKey &#038;&#038; ev.keyCode == 13)<br />
{<br />
document.getElementById(&#8220;submit&#8221;).click();<br />
}<br />
}</p>
<p>然后继续在 comments.php 文件中找到下面这句：</p>
<p>将 value=&#8221;Submit&#8221;（不同的主题可能会有些差别，其实就是提交的那个按扭）的 value 值里加上一个(Ctrl+Enter)，改成 value=&#8221;Submit(Ctrl+Enter)&#8221;</p>
<p>方法二：(万戈)</p>
<p>　在 comments.php 中找到以下代码：</p>
<p>修改为：</p>
<p>总结：相比来说，第二种方法更简单，却实现了相同的效果。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.result-search.com/sty/2009/07/20/%e7%bb%99wp%e6%b7%bb%e5%8a%a0ctrlenter%e5%9b%9e%e5%a4%8d%e5%bf%ab%e6%8d%b7%e9%94%ae.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
