﻿<?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>Xixi&#039;s Blog &#187; WordPress</title>
	<atom:link href="http://www.xixis.net/archives/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xixis.net</link>
	<description>http://www.xixis.net  &#124;  Eternal Sunshine of the Spotless Mind</description>
	<lastBuildDate>Thu, 12 Jan 2012 06:04:19 +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>WordPress后台升级免输入FTP帐号</title>
		<link>http://www.xixis.net/archives/background-free-importation-of-wordpress-upgrade-ftp-account.html</link>
		<comments>http://www.xixis.net/archives/background-free-importation-of-wordpress-upgrade-ftp-account.html#comments</comments>
		<pubDate>Mon, 05 Jul 2010 13:34:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/wordpress%e5%90%8e%e5%8f%b0%e5%8d%87%e7%ba%a7%e5%85%8d%e8%be%93%e5%85%a5ftp%e5%b8%90%e5%8f%b7.html</guid>
		<description><![CDATA[新版的WordPress自带了插件自动升级的功能。每次安装的插件有了新版本，只要点一个链接，就自动完成下载、解压、禁用插件、升级、重新启用这一系列步骤。常方便。但有些空间选择升级时会提示需要主机的FTP用户名和密码。
这个blog安装在linux系统上，第一感觉可能是权限的问题，反正是内部的服务器，随便折腾，就都设置成777。结果还是不行，就仔细地跟进去查了一下，发现问题在一个叫做“get_filesystem_method”的函数上。找到这样一个解释：
(FTP) it only uses this when it detects that files it creates have the wrong owner name

一下得到了提醒，可能是因为跑PHP进程的用户名和WP文件夹的所有者不同。于是用chown命令更改了文件所有者，命令用法如下：
chown -R www *

就是把目录下所有文件和文件夹的所有者改成叫做www的用户。这样再去尝试WP的自动升级，一键升级就能顺利进行了。
]]></description>
			<content:encoded><![CDATA[<p>新版的<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>自带了插件自动升级的功能。每次安装的插件有了新版本，只要点一个链接，就自动完成下载、解压、禁用插件、升级、重新启用这一系列步骤。常方便。但有些空间选择升级时会提示需要主机的FTP用户名和密码。</p>
<p>这个blog安装在<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/linux" title="显示linux的所有日志" target="_blank">linux</a></span>系统上，第一感觉可能是权限的问题，反正是内部的服务器，随便折腾，就都设置成777。结果还是不行，就仔细地跟进去查了一下，发现问题在一个叫做“<a href="http://wordpress.org/support/topic/164174">get_filesystem_method</a>”的函数上。找到这样一个解释：</p>
<blockquote><p>(FTP) it only uses this when it detects that files it creates have the wrong owner name</p>
</blockquote>
<p>一下得到了提醒，可能是因为跑PHP进程的用户名和WP文件夹的所有者不同。于是用chown命令更改了文件所有者，命令用法如下：</p>
<blockquote><p>chown -R www *</p>
</blockquote>
<p>就是把目录下所有文件和文件夹的所有者改成叫做www的用户。这样再去尝试WP的自动升级，一键升级就能顺利进行了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/background-free-importation-of-wordpress-upgrade-ftp-account.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress插件&#8220;Simple Tags&#8221;1.8版本错误修正</title>
		<link>http://www.xixis.net/archives/wordpress-plugin-u0026quotsimple-tagsu0026quot-1-8-version-of-the-error-correction.html</link>
		<comments>http://www.xixis.net/archives/wordpress-plugin-u0026quotsimple-tagsu0026quot-1-8-version-of-the-error-correction.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 19:24:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[simple-tags]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/wordpress%e6%8f%92%e4%bb%b6simple-tags1-8%e7%89%88%e6%9c%ac%e9%94%99%e8%af%af%e4%bf%ae%e6%ad%a3.html</guid>
		<description><![CDATA[在WordPress 3.0 以下版本安装版本号为1.8的Simple Tags插件后，如果使用该插件的Tag cloud 功能，则会提示错误，如图所示：

该错误发生在plugins/simple-tags/inc/client.php文件中第1699行中，taxonomy_exists()函数不存在。经查，该函数是在wordpress 3.0中新增，用来替换原来的is_taxonomy()函数。
解决办法，升级到wordpress 3.0 或 将Simple Tags中taxonomy_exists()修改为is_taxonomy()。
]]></description>
			<content:encoded><![CDATA[<p>在WordPress 3.0 以下版本安装版本号为1.8的Simple Tags插件后，如果使用该插件的Tag cloud 功能，则会提示错误，如图所示：</p>
<p><a href="http://picasaweb.google.com/lh/photo/nDLe92LF1BNtX9pM0aSobg?feat=embedwebsite"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://sub.xixis.net/wp-content/uploads/2010/07/clip_image0021.jpg" width="131" height="229" /></a></p>
<p>该错误发生在<b>plugins/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/simple-tags" title="显示simple-tags的所有日志" target="_blank">simple-tags</a></span>/inc/client.php</b>文件中第1699行中，<b>taxonomy_exists()</b>函数不存在。经查，该函数是在wordpress 3.0中新增，用来替换原来的<b>is_taxonomy()</b>函数。</p>
<p>解决办法，升级到wordpress 3.0 或 将Simple Tags中<b>taxonomy_exists()</b>修改为<b>is_taxonomy()</b>。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-plugin-u0026quotsimple-tagsu0026quot-1-8-version-of-the-error-correction.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress SEO 优化技巧</title>
		<link>http://www.xixis.net/archives/wordpress-seo-optimization-tips.html</link>
		<comments>http://www.xixis.net/archives/wordpress-seo-optimization-tips.html#comments</comments>
		<pubDate>Sun, 18 Apr 2010 17:53:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/wordpress-seo-%e4%bc%98%e5%8c%96%e6%8a%80%e5%b7%a7.html</guid>
		<description><![CDATA[WordPress 如何 SEO, 虽然内容为王，但是，每天花一小点时间进行 SEO ，却会使你事半功倍，建站更轻松。  WordPress 有利于 SEO 的良好的永久链接结构, 
1.WordPress URL 链接结构建议:
  采用自定义结构/%postname%/.html这种链接结构，这样我们可以在 url 中加入关键词，使人一目了然。 
2.WordPress Meta SEO 优化:
  在 header.php 里加上,

&#60;?if &#40;is_home&#40;&#41;&#41;&#123;
&#160;
$description = &#34;xixi的个人博客(Blog)，分享Wordpress技巧，关注Web 2.0, 网站SEO优化排名, jQuery，Wordpress。&#34;;
&#160;
$keywords = &#34;Wordpress, Web 2.0, Theme, xixis, 网站SEO优化排名&#34;;
&#160;
&#125; else if &#40;is_single&#40;&#41;&#41; &#123;
&#160;
$keywords = get_post_meta&#40;$post-&#62;ID, &#34;keywords&#34;, true&#41;;
&#160;
$description = get_post_meta&#40;$post-&#62;ID, &#34;description&#34;, true&#41;;
&#160;
&#125; else if &#40;is_category&#40;&#41;&#41; &#123;
&#160;
$keywords = single_cat_title&#40;'', false&#41;;
&#160;
&#125; else if &#40;is_tag&#40;&#41;&#41; &#123;
&#160;
$keywords = single_tag_title&#40;'', false&#41;;
&#160;
&#125;
&#160;
?&#62;
&#160;
&#60;meta name=&#34;keywords&#34; content=&#34;&#60;?=$keywords?&#62;&#34; /&#62;
&#160;
&#60;meta name=&#34;description&#34; content=&#34;&#60;?=$description?&#62;&#34; /&#62;

3.合理的导航结构:

域名>title>h1>h2&#8230; 文章关联度再好，SEO 技术多么过硬，也敌不过别人一个域名。所以，我们应该选择热门度较高的组合关键词。

1）、关键词应该出现在 URL 里
2）、网站标题、文章标题里应该包含关键词
3）、在图像 alt 标签里放入关键词
4）、文章开头部分出现关键词（关键词密度最好不要超过10%）

4.避免重复内容:


1）、首页摘要输出
2）、分类、TAG 页、存档页摘要输出和只输出文章标题

5. WordPress robots.txt SEO 优化:

robots.txt 的作用是引导 google、百度等搜索引擎的爬虫进行索引，告诉他们哪些内容不允许其索引与收录。合理的 robots.txt 设置，不但可以有效的节省搜索引擎对服务器带宽的占用，还可以提高网站在搜索引擎中的排名。那么，使用 WordPress 的朋友，可以这样设置：

User-agent: *
Disallow: /index.php
Disallow: ...]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 如何 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/seo" title="显示SEO的所有日志" target="_blank">SEO</a></span>, 虽然内容为王，但是，每天花一小点时间进行 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/seo" title="显示SEO的所有日志" target="_blank">SEO</a></span> ，却会使你事半功倍，建站更轻松。<br />  <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 有利于 SEO 的良好的永久链接结构,<br /> <span id="more-498"></span><br />
<h3>1.WordPress URL 链接结构建议:</h3>
<p>  采用自定义结构/%postname%/.html这种链接结构，这样我们可以在 url 中加入关键词，使人一目了然。<br /> <br />
<h3>2.WordPress Meta SEO 优化:</h3>
<p>  在 header.php 里加上,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xixi的个人博客(Blog)，分享Wordpress技巧，关注Web 2.0, 网站SEO优化排名, jQuery，Wordpress。&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Wordpress, Web 2.0, Theme, xixis, 网站SEO优化排名&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;keywords&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> single_cat_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_tag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000088;">$keywords</span> <span style="color: #339933;">=</span> single_tag_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;meta name=&quot;keywords&quot; content=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$keywords</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
&nbsp;
&lt;meta name=&quot;description&quot; content=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$description</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;</pre></div></div>

<h3>3.合理的导航结构:</h3>
<p></p>
<p>域名>title>h1>h2&#8230; 文章关联度再好，SEO 技术多么过硬，也敌不过别人一个域名。所以，我们应该选择热门度较高的组合关键词。</p>
<blockquote><p>
1）、关键词应该出现在 URL 里</p>
<p>2）、网站标题、文章标题里应该包含关键词</p>
<p>3）、在图像 alt 标签里放入关键词</p>
<p>4）、文章开头部分出现关键词（关键词密度最好不要超过10%）
</p></blockquote>
<h3>4.避免重复内容:</h3>
<p></p>
<blockquote><p>
1）、首页摘要输出</p>
<p>2）、分类、TAG 页、存档页摘要输出和只输出文章标题
</p></blockquote>
<h3>5. WordPress robots.txt SEO 优化:</h3>
<p></p>
<p>robots.txt 的作用是引导 google、百度等搜索引擎的爬虫进行索引，告诉他们哪些内容不允许其索引与收录。合理的 robots.txt 设置，不但可以有效的节省搜索引擎对服务器带宽的占用，还可以提高网站在搜索引擎中的排名。那么，使用 WordPress 的朋友，可以这样设置：</p>
<blockquote><p>
User-agent: *</p>
<p>Disallow: /index.php</p>
<p>Disallow: /cgi-bin</p>
<p>Disallow: /wp-</p>
<p>Disallow: /feed</p>
<p>Disallow: /*/feed</p>
<p>Disallow: /category/*/*</p>
<p>Disallow: /tag</p>
<p>Disallow: /category/*</p>
<p>Disallow: /*/trackback</p>
<p>Disallow: /*?</p>
<p>Disallow: /page</p>
<p>Sitemap: http://www.xixis.net/sitemap.xml
</p></blockquote>
<p>本文的例子不能通用，请一定根据自己的实际需求进行相应操作。</p>
<p>保持更新服务</p>
<p>在选项–撰写字下面有一个更新服务，当你在有新的文章更新的时候，wordpress会自动把你的更新内容通知到你所填写的更新服务中去，确保各大 搜索引擎和网址目录服务更够在最短时间更新你的博客。</p>
<p>这里推荐一些更新地址：</p>
<blockquote>
<p>http://blogsearch.google.com/ping/RPC2</p>
<p>http://1470.net/api/ping</p>
<p>http://api.feedster.com/ping</p>
<p>http://api.feedster.com/ping.php</p>
<p>http://api.moreover.com/ping</p>
<p>http://api.moreover.com/RPC2</p>
<p>http://api.my.yahoo.com/RPC2</p>
<p>http://api.my.yahoo.com/rss/ping</p>
<p>http://bblog.com/ping.php</p>
<p>http://bitacoras.net/ping</p>
<p>http://blogdb.jp/xmlrpc</p>
<p>http://blog.goo.ne.jp/XMLRPC</p>
<p>http://blogsearch.google.com/ping/RPC2</p>
<p>http://blogmatcher.com/u.php</p>
<p>http://bulkfeeds.net/rpc</p>
<p>http://coreblog.org/ping/</p>
<p>http://mod-pubsub.org/kn_apps/blogchatt</p>
<p>https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast</p>
<p>http://ping.amagle.com/</p>
<p>http://ping.bitacoras.com/</p>
<p>http://ping.bloggers.jp/rpc/</p>
<p>http://ping.blogmura.jp/rpc/</p>
<p>http://ping.blo.gs/</p>
<p>http://ping.cocolog-nifty.com/xmlrpc</p>
<p>http://pinger.blogflux.com/rpc/</p>
<p>http://ping.exblog.jp/xmlrpc</p>
<p>http://ping.feedburner.com/</p>
<p>http://ping.myblog.jp/</p>
<p>http://pingqueue.com/rpc/</p>
<p>http://ping.blogg.de/</p>
<p>http://ping.rootblog.com/rpc.php</p>
<p>http://ping.syndic8.com/xmlrpc.php</p>
<p>http://ping.weblogalot.com/rpc.php</p>
<p>http://ping.weblogs.se/</p>
<p>http://rcs.datashed.net/RPC2/</p>
<p>http://rpc.blogbuzzmachine.com/RPC2</p>
<p>http://rpc.blogrolling.com/pinger/</p>
<p>http://rpc.britblog.com/</p>
<p>http://rpc.icerocket.com:10080/</p>
<p>http://rpc.newsgator.com/</p>
<p>http://rpc.pingomatic.com/</p>
<p>http://rpc.tailrank.com/feedburner/RPC2</p>
<p>http://rpc.technorati.com/rpc/ping</p>
<p>http://rpc.weblogs.com/RPC2</p>
<p>http://rpc.wpkeys.com/</p>
<p>http://services.newsgator.com/ngws/xmlrpcping.aspx</p>
<p>http://signup.alerts.msn.com/alerts-PREP/submitPingExtended.doz</p>
<p>http://topicexchange.com/RPC2</p>
<p>http://trackback.bakeinu.jp/bakeping.php</p>
<p>http://www.a2b.cc/setloc/bp.a2b</p>
<p>http://www.bitacoles.net/ping.php</p>
<p>http://www.blogdigger.com/RPC2</p>
<p>http://www.blogoole.com/ping/</p>
<p>http://www.blogoon.net/ping/</p>
<p>http://www.blogpeople.net/servlet/weblogUpdates</p>
<p>http://www.blogroots.com/tb_populi.blog?id=1</p>
<p>http://www.blogshares.com/rpc.php</p>
<p>http://www.blogsnow.com/ping</p>
<p>http://www.blogstreet.com/xrbin/xmlrpc.cgi</p>
<p>http://www.holycowdude.com/rpc/ping/</p>
<p>http://www.lasermemory.com/lsrpc/</p>
<p>http://www.imblogs.net/ping/</p>
<p>http://www.mod-pubsub.org/kn_apps/blogchatter/ping.php</p>
<p>http://www.newsisfree.com/RPCCloud</p>
<p>http://www.newsisfree.com/xmlrpctest.php</p>
<p>http://www.popdex.com/addsite.php</p>
<p>http://www.snipsnap.org/RPC2</p>
<p>http://www.weblogues.com/RPC/</p>
<p>http://xmlrpc.blogg.de/</p>
</blockquote>
<p>可以把这些地址都填写到那个更新服务中去，不过这样做可能会增加你的博客的工作量，有时候会导致速度变慢。</p>
<p>修改你的wordpress主题，使得标题显示对搜索引擎更加友好</p>
<p>很多博客在点击某一片文章的时候，这个页面的标题title往往是如此：博客名/分类/文章名称。但是搜索引擎一般对title前面的几个字母比较看重，但是这个时候你的文章名称却在最后，所以你要做适当的修改，在你的主题title这一项，可以做一下修改：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$the_title</span> <span style="color: #339933;">=</span> wp_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' - '</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$the_title</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这样是不是好多了？</p>
<p>好了，今天的小技巧就到这里吧。如果您有其他的 WordPress SEO 技巧，欢迎留言分享。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-seo-optimization-tips.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress的主循环及全局变量</title>
		<link>http://www.xixis.net/archives/wordpress-main-loop-and-the-global-variable.html</link>
		<comments>http://www.xixis.net/archives/wordpress-main-loop-and-the-global-variable.html#comments</comments>
		<pubDate>Sun, 18 Apr 2010 17:24:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[global variable]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[主循环]]></category>
		<category><![CDATA[全局变量]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/wordpress%e7%9a%84%e4%b8%bb%e5%be%aa%e7%8e%af%e5%8f%8a%e5%85%a8%e5%b1%80%e5%8f%98%e9%87%8f.html</guid>
		<description><![CDATA[ 当我们制作 WordPress 插件的时候，首先必须要了解 WordPress 主循环和全局变量。这样，我们在制作插件的时候，就可以知道可以访问哪个变量，不能访问哪个变量。
对于特定的 WordPress Action 和 Filters，你可以很容易知道它们在主循环中哪里执行了。然而有时你在主循环中不想使用 action 或者 filter 而只想调用模板函数（template tag ）。这时候，你需要非常了解你想访问的全局变量和可能得到的结果。
下面我将讲解 WordPress 主循环，以便你能更好理解哪些全局变量可以被主循环中的模板函数调用。
WordPress 主循环 &#8212; The WordPress Loop

WordPress 主循环是用来在一些页面上显示日志列表和在单篇日志页面页显示留言列表的。
在默认主题的 index.php 中，主循环是以下面这些代码开始的：
&#60;?php if (have_posts()) : ?&#62;
&#60;?php while (have_posts()) : the_post(); ?&#62;
have_posts() 和 the_post() 这两个函数都是属性函数，它们可以访问到类 WP_Query 中的方法。
have_posts 这个函数去查看当前显示的日志数是否达到了在 WordPress 后台设置的要显示的日志数，这个主循环将会继续直到达到为止。
如果你研究过 the_post 函数，你会发现它会搜索 $post 这个全局变量。 the_post 函数获取第一篇日志（随后的日志通过每次循环迭代获取），并设置日志的数据（如作者，多重-页面，等等），这些数据是 WordPress 全局的赋给 $post 这个变量，所以可以访问它。
在 the_post() 函数被调用之后，你就可以使用许多模板函数和全局变量。
下面就是现在可用的模板函数的一些例子：

the_author：获取作者的名字。
the_title：显示当前日志的标题。
the_content：显示日志的内容。
the_permalink：显示日志的永久链接的 URL。
the_ID：显示日志的 ID。

下面是现在可用的全局变量：

全局变量 authordata，你可以使用以下代码调用它：

· global $authordata;
echo $authordata-&#62;display_name;
通过 authordata 这个全局变量还可以让你获取：last_name，first_name，ID，user_email，user_url，user_login，description 和其他。

全局变量 post，你可以使用以下代码调用它：

· global $post;
· echo $post-&#62;post_title;
通过post这个全局变量还可以让你获取：ID，post_author，post_date，post_excerpt，comment_count 和其他。

全局变量 post ，你可以通过在一个函数中使用以下代码调用它：

· global $post;
· echo $post-&#62;post_content;
通过这种方法获取的日志内容是没有经过过虑的。如果你想按照你自己喜好去操纵日志的内容，比如自己设置日志内容的显示方式，通过这种方式获取的日志内容非常有用。

虽然没有快速的全局访问，但是 the_permalink 这个函数作的就是输出函数 get_permalink 在 $id 这个变量已经被设定情况下的结果。
全局变量 id ，你可以使用以下代码调用它：


global $id;
&#160;
echo $id;

一个自定义模板函数的例子
假设你写了一个叫做 get_my_trackback 自定义的模板函数，它能够在留言循环中每次侦测到 trackback 的时候做出反应。我们将把这个函数放入 comment.php ...]]></description>
			<content:encoded><![CDATA[<p> 当我们制作 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 插件的时候，首先必须要了解 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e4%b8%bb%e5%be%aa%e7%8e%af" title="显示主循环的所有日志" target="_blank">主循环</a></span>和<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e5%85%a8%e5%b1%80%e5%8f%98%e9%87%8f" title="显示全局变量的所有日志" target="_blank">全局变量</a></span>。这样，我们在制作插件的时候，就可以知道可以访问哪个变量，不能访问哪个变量。<span id="more-497"></span></p>
<p>对于特定的 WordPress <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">Action</a> 和 <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">Filters</a>，你可以很容易知道它们在<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e4%b8%bb%e5%be%aa%e7%8e%af" title="显示主循环的所有日志" target="_blank">主循环</a></span>中哪里执行了。然而有时你在主循环中不想使用 action 或者 filter 而只想调用模板函数（template tag ）。这时候，你需要非常了解你想访问的<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e5%85%a8%e5%b1%80%e5%8f%98%e9%87%8f" title="显示全局变量的所有日志" target="_blank">全局变量</a></span>和可能得到的结果。</p>
<p>下面我将讲解 WordPress 主循环，以便你能更好理解哪些全局变量可以被主循环中的模板函数调用。</p>
<p><strong>WordPress </strong><strong>主循环 &#8212; The WordPress Loop</strong></p>
<p><a rel="lightbox" href="http://sub.xixis.net/wp-content/uploads/2010/04/clip_image001.gif"><img style="display: inline; border: 0px;" title="clip_image001" src="http://sub.xixis.net/wp-content/uploads/2010/04/clip_image001_thumb.gif" border="0" alt="clip_image001" width="426" height="312" /></a></p>
<p><a href="http://codex.wordpress.org/The_Loop">WordPress 主循环</a>是用来在一些页面上显示日志列表和在单篇日志页面页显示留言列表的。</p>
<p>在默认主题的 index.php 中，主循环是以下面这些代码开始的：</p>
<p>&lt;?php if (have_posts()) : ?&gt;</p>
<p>&lt;?php while (have_posts()) : the_post(); ?&gt;</p>
<p><strong>have_posts()</strong> 和 <strong>the_post()</strong> 这两个函数都是属性函数，它们可以访问到类 <a href="http://codex.wordpress.org/Function_Reference/WP_Query">WP_Query</a> 中的方法。</p>
<p><strong>have_posts </strong>这个函数去查看当前显示的日志数是否达到了在 WordPress 后台设置的要显示的日志数，这个主循环将会继续直到达到为止。</p>
<p>如果你研究过 <strong>the_post</strong> 函数，你会发现它会搜索 <strong>$post</strong> 这个全局变量。 <strong>the_post</strong> 函数获取第一篇日志（随后的日志通过每次循环迭代获取），并设置日志的数据（如作者，多重-页面，等等），这些数据是 WordPress 全局的赋给 <strong>$post</strong> 这个变量，所以可以访问它。</p>
<p>在 <strong>the_post() </strong>函数被调用之后，你就可以使用许多<a href="http://codex.wordpress.org/Template_Tags">模板函数</a>和<a href="http://ifacethoughts.net/2006/02/25/wordpress-global-variables/">全局变量</a>。</p>
<p>下面就是现在可用的模板函数的一些例子：</p>
<ul>
<li><a href="http://codex.wordpress.org/Template_Tags/the_author">the_author</a>：获取作者的名字。</li>
<li><a href="http://codex.wordpress.org/Template_Tags/the_title">the_title</a>：显示当前日志的标题。</li>
<li><a href="http://codex.wordpress.org/Template_Tags/the_content">the_content</a>：显示日志的内容。</li>
<li><a href="http://codex.wordpress.org/Template_Tags/the_permalink">the_permalink</a>：显示日志的永久链接的 URL。</li>
<li><a href="http://codex.wordpress.org/Template_Tags/the_ID">the_ID</a>：显示日志的 ID。</li>
</ul>
<p>下面是现在可用的全局变量：</p>
<ul>
<li>全局变量 <strong>authordata</strong>，你可以使用以下代码调用它：</li>
</ul>
<p>· global $authordata;</p>
<p>echo $authordata-&gt;display_name;</p>
<p>通过<strong> authordata</strong> 这个全局变量还可以让你获取：last_name，first_name，ID，user_email，user_url，user_login，description 和其他。</p>
<ul>
<li>全局变量 <strong>post</strong>，你可以使用以下代码调用它：</li>
</ul>
<p>· global $post;</p>
<p>· echo $post-&gt;post_title;</p>
<p>通过<strong>post</strong>这个全局变量还可以让你获取：ID，post_author，post_date，post_excerpt，comment_count 和其他。</p>
<ul>
<li>全局变量 <strong>post </strong>，你可以通过在一个函数中使用以下代码调用它：</li>
</ul>
<p>· global $post;</p>
<p>· echo $post-&gt;post_content;</p>
<p>通过这种方法获取的日志内容是没有经过过虑的。如果你想按照你自己喜好去操纵日志的内容，比如自己设置日志内容的显示方式，通过这种方式获取的日志内容非常有用。</p>
<ul>
<li>虽然没有快速的全局访问，但是 <strong>the_permalink</strong> 这个函数作的就是输出函数 <strong>get_permalink</strong> 在 $id 这个变量已经被设定情况下的结果。</li>
<li>全局变量 <strong>id </strong>，你可以使用以下代码调用它：</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>一个自定义模板函数的例子</strong></p>
<p>假设你写了一个叫做 <strong>get_my_trackback</strong> 自定义的模板函数，它能够在留言循环中每次侦测到 trackback 的时候做出反应。我们将把这个函数放入 <strong>comment.php</strong> 模板文件的 foreach 留言循环中。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>p <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:--&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span>p get_my_trackback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">--&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span>p <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* end for each comment */</span><span style="color: #339933;">--&gt;</span>
&nbsp;
<span style="color: #004000;">get_my_trackback</span> 函数代码如下：
&nbsp;
<span style="color: #339933;">&lt;!--</span>p <span style="color: #000000; font-weight: bold;">function</span> get_my_trackback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$commen</span><span style="color: #339933;">--&gt;</span><span style="color: #004000;">comment_type</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'comment'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//do trackback stuff</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p><a rel="lightbox" href="http://sub.xixis.net/wp-content/uploads/2010/04/clip_image002.gif"><img style="display: inline; border: 0px;" title="clip_image002" src="http://sub.xixis.net/wp-content/uploads/2010/04/clip_image002_thumb.gif" border="0" alt="clip_image002" width="441" height="431" /></a></p>
<p><strong>comments </strong>这个全局变量能够让你访问到当前留言的详细数据，所以可以让你对留言做任何事情。</p>
<p><strong>结论</strong></p>
<p>在这篇文章中，详细解析了 WordPress 主循环已和全局变量，所以在以后制作插件或者修改主题的时候可以非常灵活的使用它们。</p>
<p>翻译自：<a href="http://weblogtoolscollection.com/archives/2007/06/06/global-variables-and-the-wordpress-loop/">Global Variables and the WordPress Loop</a>。</p>
<p>转自：http://fairyfish.net/2007/07/07/global-variables-and-the-wordpress-<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/loop" title="显示loop的所有日志" target="_blank">loop</a></span>/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-main-loop-and-the-global-variable.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用phpMyAdmin操作WordPress数据库</title>
		<link>http://www.xixis.net/archives/wordpress-database-using-phpmyadmin-to-operate.html</link>
		<comments>http://www.xixis.net/archives/wordpress-database-using-phpmyadmin-to-operate.html#comments</comments>
		<pubDate>Mon, 12 Apr 2010 15:30:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[phpMyAdmin]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/%e5%88%a9%e7%94%a8phpmyadmin%e8%bf%9b%e8%a1%8cwordpress%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e6%93%8d%e4%bd%9c.html</guid>
		<description><![CDATA[WordPress有丰富的插件、主题，成功广大博主建博客利器，WordPress博客是由MySQL提供支持的，在博客的写作过程中，有时不得不牵扯到一些对MySQL数据库的操作，虽然，插件和代码的修改也能帮我们解决问题，但是，这也是治标不治本的丰富，随意，合理的利用phpMyAdmin来进行数据的操作的十分有必要的。
 
 phpMyAdmin可以帮助我们完成哪些操作呢?本文就是向大家介绍对WordPress较有用的几个操作：     1、备份数据库     数据库备份对于我们站长来说是非常必要的，这次的网络风暴牵扯到很多站长，如果网站备份的话，那么它就可以在短时间内恢复起来，不让的会，你的网站也就OVER了，当然，你也可以使用WP-DB-Backup插件执行数据库备份非常方便，WordPress用户可以安装这个插件并定期备份数据。     2、快速删除垃圾评论     wordpress互动性强也是它的优点之一，可以这个优点被却被很多的垃圾广告所利用，不过，通过一条简单的删除语句，就可以解决这个问题了，执行这个命令：     DELETE from wp_comments WHERE comment_approved = ‘0′;     那么，所有的垃圾广告就可以删除完毕了。     3、手动重设密码     wordpress为了增加安全性，会自动生成不易破解的秘密，但是，有时博主也会出现忘记密码的事情发生，这是，我们，就可以通过phpmyadmin来进行重新修改密码了，使用如下命令就可以了：     UPDATE `wp_users` SET `user_pass` = MD5(’PASSWORD’) WHERE `wp_users`.`user_login` =`admin` LIMIT 1;     这样密码就修改成功了。     4、更换域名     重新更换域名，那么，需要在保留博客和数据的同时改变博客的域名。由于WordPress把域名存储在数据库中，所以为了把新域名和博客连接起来，你必须更改数据库，使用如下命令进行修改：     UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldsite.com’, ...]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>有丰富的插件、主题，成功广大博主建博客利器，<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>博客是由MySQL提供支持的，在博客的写作过程中，有时不得不牵扯到一些对MySQL数据库的操作，虽然，插件和代码的修改也能帮我们解决问题，但是，这也是治标不治本的丰富，随意，合理的利用<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/phpmyadmin" title="显示phpMyAdmin的所有日志" target="_blank">phpMyAdmin</a></span>来进行数据的操作的十分有必要的。</p>
<p> <span id="more-481"></span>
<p> <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/phpmyadmin" title="显示phpMyAdmin的所有日志" target="_blank">phpMyAdmin</a></span>可以帮助我们完成哪些操作呢?本文就是向大家介绍对<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>较有用的几个操作：    <br /> <strong>1、备份数据库</strong>    <br /> 数据库备份对于我们站长来说是非常必要的，这次的网络风暴牵扯到很多站长，如果网站备份的话，那么它就可以在短时间内恢复起来，不让的会，你的网站也就OVER了，当然，你也可以使用WP-DB-Backup插件执行数据库备份非常方便，WordPress用户可以安装这个插件并定期备份数据。    <br /> <strong>2、快速删除垃圾评论</strong>    <br /> wordpress互动性强也是它的优点之一，可以这个优点被却被很多的垃圾广告所利用，不过，通过一条简单的删除语句，就可以解决这个问题了，执行这个命令：    <br /> DELETE from wp_comments WHERE comment_approved = ‘0′;    <br /> 那么，所有的垃圾广告就可以删除完毕了。    <br /> <strong>3、手动重设密码</strong>    <br /> wordpress为了增加安全性，会自动生成不易破解的秘密，但是，有时博主也会出现忘记密码的事情发生，这是，我们，就可以通过phpmyadmin来进行重新修改密码了，使用如下命令就可以了：    <br /> UPDATE `wp_users` SET `user_pass` = MD5(’PASSWORD’) WHERE `wp_users`.`user_login` =`admin` LIMIT 1;    <br /> 这样密码就修改成功了。    <br /> <strong>4、更换域名</strong>    <br /> 重新更换域名，那么，需要在保留博客和数据的同时改变博客的域名。由于WordPress把域名存储在数据库中，所以为了把新域名和博客连接起来，你必须更改数据库，使用如下命令进行修改：    <br /> UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldsite.com’, ‘http://www.newsite.com’) WHERE option_name = ‘home’ OR option_name = ’siteurl’;    <br /> 使用以下语句替代所有日志的相对URL(guid全局唯一标识符)    <br /> UPDATE wp_posts SET guid = replace(guid, ‘http://www.oldsite.com’,’http://www.newsite.com’);    <br /> 搜索wp_posts表并替代其中的URL，以确保没有老的URL存在了:    <br /> UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.oldsite.com’, ‘http://www.newsite.com’);    <br /> 这样就完成了域名的修改了，你有可以完整的使用你的博客了    <br /> <strong>5、修改WordPress数据库</strong>    <br /> wordpress版本升级比较的快，所以，升级博客十分的又不用，如果修改或升级过程或其它原因造成了博客数据的丢失或损坏，希望你有备份的数据库，这样，你可以把备份的数据库导入到数据库中以弥补损失。    <br /> 除了上面介绍的五种方法外，我们还可以利用它“更改日志属性”等操作，总体上来说，phpmyadmin功能还是非常强的，它可以有助于我们更好的使用Mysql数据库.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-database-using-phpmyadmin-to-operate.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A wonderful free wordpress themes site</title>
		<link>http://www.xixis.net/archives/a-wonderful-free-wordpress-themes-site.html</link>
		<comments>http://www.xixis.net/archives/a-wonderful-free-wordpress-themes-site.html#comments</comments>
		<pubDate>Thu, 08 Apr 2010 08:11:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/a-wonderful-free-wordpress-themes-site.html</guid>
		<description><![CDATA[I have been looking for WP templates on Wordpress.org until I found this site:wprex.com, “which provides a number of finest quality and innovative WP themes”, in their words. But I suppose that, despite it does not have as many themes as Wordpress.org has, it provides more elaborate and more Multifunction templates as they can. In addition, the more detailed Specification helps me to find my favor themes a lot. So I recommend this wordpres​s themes​ site. By the way, it is wholly free and Easy to download wordpress templates without ...]]></description>
			<content:encoded><![CDATA[<p>I have been looking for WP templates on <a href="http://www.wordpress.org" target="_blank">Wordpress.org</a> until I found this site:<a href="http://www.wprex.com/" target="_blank">wprex.com</a>, “which provides a number of finest quality and innovative WP themes”, in their words. But I suppose that, despite it does not have as many themes as <a href="http://www.wordpress.org" target="_blank">Wordpress.org</a> has, it provides more elaborate and more Multifunction templates as they can. In addition, the more detailed Specification helps me to find my favor themes a lot. So I recommend this <a href="http://www.wprex.com/">wordpres​s themes​</a> site. By the way, it is wholly free and Easy to download wordpress templates without login or any hassle.</p>
<p>Please visit : <a href="http://www.wprex.com/">http://www.wprex.com</a> and find your themes in your style.</p>
<p><a href="http://sub.xixis.net/wp-content/uploads/2010/04/wprex.jpg" rel="lightbox"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="wprex" border="0" alt="wprex" src="http://sub.xixis.net/wp-content/uploads/2010/04/wprex_thumb.jpg" width="306" height="407" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/a-wonderful-free-wordpress-themes-site.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决Twitter tools 中文链接问题</title>
		<link>http://www.xixis.net/archives/twitter-tools-to-solve-problems-in-chinese-links.html</link>
		<comments>http://www.xixis.net/archives/twitter-tools-to-solve-problems-in-chinese-links.html#comments</comments>
		<pubDate>Sat, 13 Mar 2010 17:45:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[cos_slug_translator]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter tools]]></category>
		<category><![CDATA[中文链接]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/%e8%a7%a3%e5%86%b3twitter-tools-%e4%b8%ad%e6%96%87%e9%93%be%e6%8e%a5%e9%97%ae%e9%a2%98.html</guid>
		<description><![CDATA[使用Twitter tools 插件，可以将最新的Post发送到Twitter上，确实很方便。由于我的永久链接（permalink）格式为
/archives/%postname%.html

文章链接中含有文章标题，当标题为中文的时候不太美观，所以用cos_slug_translator这个插件将中文标题转换为英文。但是我用Twitter Tools的时候就出现了问题：发送到Twitter上的链接依然含有中文，访问的话就是404错误。
 
初步判断应该是Twitter tools插件先于cos_slug_translator运行了。于是修改了一下twitter-tools.php文件，将问题解决：
1. 在twitter-tools.php文件开头添加：

require_once &#40;ABSPATH.&#34;wp-content/plugins/cos_slug_translator.php&#34;&#41;;

一定要将双引号内的路径修改为你的cos_slug_translator路径。
2.找到twitter-tools.php文件512行左右：

$url = apply_filters&#40;'tweet_blog_post_url', get_permalink&#40;$post_id&#41;&#41;;

将其注释掉，并在下面添加或修改：

1
2
3
4
5
6
7
$tweet = new aktt_tweet;
//$url = apply_filters('tweet_blog_post_url', get_permalink($post_id));
$tit_o = cos_tranlate&#40;@html_entity_decode&#40;$post-&#62;post_title, ENT_COMPAT, 'UTF-8'&#41;&#41;;
$url_o = site_url&#40;'/archives/'&#41;.sanitize_title&#40;$tit_o&#41;.'.html';
$url = apply_filters&#40;'tweet_blog_post_url', $url_o&#41;;
$tweet-&#62;tw_text = sprintf&#40;__&#40;$this-&#62;tweet_format, 'twitter-tools'&#41;, @html_entity_decode&#40;$post-&#62;post_title, ENT_COMPAT, 'UTF-8'&#41;, $url&#41;;
$tweet = apply_filters&#40;'aktt_do_blog_post_tweet', $tweet, $post&#41;; // return false here to not tweet

注意第三和第四行是添加的，第五行要修改。
注意第四行的永久链接格式，如果和我的相同，不用修改，如果你的永久链接格式为：

/yourfolder/%postname%.html

或

/yourfolder/%postname%/

请将第四行代码修改为：

$url_o = site_url&#40;'/yourfolder/'&#41;.sanitize_title&#40;$tit_o&#41;.'.html';

或

$url_o = site_url&#40;'/yourfolder/'&#41;.sanitize_title&#40;$tit_o&#41;.'/';

最后将twitter-tools.php文件上传并覆盖即可。
Ps：不知道我遇到的问题是不是个例啊？
]]></description>
			<content:encoded><![CDATA[<p>使用<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/twitter" title="显示Twitter的所有日志" target="_blank">Twitter</a></span> tools 插件，可以将最新的Post发送到<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/twitter" title="显示Twitter的所有日志" target="_blank">Twitter</a></span>上，确实很方便。由于我的永久链接（permalink）格式为</p>
<blockquote><p>/archives/%postname%.html</p>
</blockquote>
<p>文章链接中含有文章标题，当标题为中文的时候不太美观，所以用<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/cos_slug_translator" title="显示cos_slug_translator的所有日志" target="_blank">cos_slug_translator</a></span>这个插件将中文标题转换为英文。但是我用Twitter Tools的时候就出现了问题：发送到Twitter上的链接依然含有中文，访问的话就是404错误。</p>
<p> <span id="more-432"></span>
<p>初步判断应该是<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/twitter-tools" title="显示Twitter tools的所有日志" target="_blank">Twitter tools</a></span>插件先于<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/cos_slug_translator" title="显示cos_slug_translator的所有日志" target="_blank">cos_slug_translator</a></span>运行了。于是修改了一下twitter-tools.php文件，将问题解决：</p>
<p>1. 在twitter-tools.php文件开头添加：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span>ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;wp-content/plugins/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/cos_slug_translator" title="显示cos_slug_translator的所有日志" target="_blank">cos_slug_translator</a></span>.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong><font face="宋体" color="#FF0000" size="2">一定要将双引号内的路径修改为你的cos_slug_translator路径。</font></strong></p>
<p>2.找到twitter-tools.php文件512行左右：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tweet_blog_post_url'</span><span style="color: #339933;">,</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>将其注释掉，并在下面添加或修改：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$tweet</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> aktt_tweet<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//$url = apply_filters('tweet_blog_post_url', get_permalink($post_id));</span>
<span style="color: #000088;">$tit_o</span> <span style="color: #339933;">=</span> cos_tranlate<span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">html_entity_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">ENT_COMPAT</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'UTF-8'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url_o</span> <span style="color: #339933;">=</span> site_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/archives/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>sanitize_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tit_o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.html'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tweet_blog_post_url'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url_o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tweet</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tw_text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tweet_format</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'twitter-tools'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #339933;">@</span><span style="color: #990000;">html_entity_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">ENT_COMPAT</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'UTF-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tweet</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'aktt_do_blog_post_tweet'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tweet</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// return false here to not tweet</span></pre></td></tr></table></div>

<p><strong><font face="宋体" color="#FF0000" size="2">注意第三和第四行是添加的，第五行要修改。</font></strong></p>
<p><strong><font face="宋体" color="#FF0000" size="2">注意第四行的永久链接格式，如果和我的相同，不用修改，如果你的永久链接格式为：</font></strong></p>
<blockquote>
<p>/<font face="宋体" color="#FF0000" size="2">yourfolder</font>/%postname%.html</p>
</blockquote>
<p>或</p>
<blockquote>
<p>/<font face="宋体" color="#FF0000" size="2">yourfolder</font>/%postname%/</p>
</blockquote>
<p>请将第四行代码修改为：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$url_o</span> <span style="color: #339933;">=</span> site_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/yourfolder/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>sanitize_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tit_o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.html'</span><span style="color: #339933;">;</span></pre></div></div>

<p>或</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$url_o</span> <span style="color: #339933;">=</span> site_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/yourfolder/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>sanitize_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tit_o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span></pre></div></div>

<p>最后将twitter-tools.php文件上传并覆盖即可。</p>
<p>Ps：不知道我遇到的问题是不是个例啊？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/twitter-tools-to-solve-problems-in-chinese-links.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 统计代码插件化</title>
		<link>http://www.xixis.net/archives/statistics-code-of-wordpress-plugins.html</link>
		<comments>http://www.xixis.net/archives/statistics-code-of-wordpress-plugins.html#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:01:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/wordpress-%e7%bb%9f%e8%ae%a1%e4%bb%a3%e7%a0%81%e6%8f%92%e4%bb%b6%e5%8c%96.html</guid>
		<description><![CDATA[转自芒果
为 WordPress 添加统计代码通常采用在 footer.php 文件直接嵌入的方式。一旦主题更换，就需要重新插入统计代码，比较麻烦。
以芒果使用的 Google Analytics 为例，可以将其以插件的形式嵌入源代码，从而避免修改模板文件。
 
首先，将以下代码保存为 google-analytics.php：

&#60;?php
/*
Plugin Name: Google Analytics
Plugin URI: http://www.mangguo.org/
Description: This plugin allows you to add google analytics Tracking code to your page.
Author: Mangguo
Version: 1.0
Author URI: http://www.mangguo.org/
*/
add_action&#40;'wp_footer', 'google_analytics_code'&#41;;
function google_analytics_code&#40;&#41;
&#123;
 include&#40;'google-analytics.txt'&#41;;
&#125;
?&#62;


在上述代码中，通过 add_action 函数在页面底部引入 Google Analytics 插件。注释部分是插件信息，可以根据需要修改。当然，将 add_action 函数中的 wp_footer 替换为 wp_head 即可实现在页面头部引用统计代码，但会拖慢页面加载速度，一般不建议采用。
然后，将以下统计代码保存为 google-analytics.txt：

&#60;!-- Google Analytics --&#62;
&#60;script type=&#34;text/javascript&#34;&#62;
var gaJsHost = ((&#34;https:&#34; == document.location.protocol) ? &#34;https://ssl.&#34; : &#34;http://www.&#34;);
document.write(unescape(&#34;%3Cscript src='&#34; + gaJsHost + &#34;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&#34;));
&#60;/script&#62;
&#60;script type=&#34;text/javascript&#34;&#62;
var pageTracker = _gat._getTracker(&#34;UA-XXXXXX-X&#34;);
pageTracker._trackPageview();
&#60;/script&#62;

其中，UA-XXXXXX-X 字符串为统计账号，需根据实际情况修改。
最后，将 google-analytics.php 和 google-analytics.txt 文件拷贝至 google-analytics 文件夹，并上传至插件目录，在 WordPress 插件管理面板激活启用即可。
]]></description>
			<content:encoded><![CDATA[<p>转自<a href="http://www.mangguo.org/wordpress-statistical-code-plugin/" target="_blank">芒果</a>
<p>为 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 添加统计代码通常采用在 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/footer" title="显示footer的所有日志" target="_blank">footer</a></span>.<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/php" title="显示php的所有日志" target="_blank">php</a></span> 文件直接嵌入的方式。一旦主题更换，就需要重新插入统计代码，比较麻烦。</p>
<p>以芒果使用的 Google Analytics 为例，可以将其以插件的形式嵌入源代码，从而避免修改模板文件。</p>
<p> <span id="more-418"></span>
<p>首先，将以下代码保存为 google-analytics.<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/php" title="显示php的所有日志" target="_blank">php</a></span>：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Google Analytics
Plugin URI: http://www.mangguo.org/
Description: This plugin allows you to add google analytics Tracking code to your page.
Author: Mangguo
Version: 1.0
Author URI: http://www.mangguo.org/
*/</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'google_analytics_code'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> google_analytics_code<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
 <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'google-analytics.txt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>
在上述代码中，通过 add_action 函数在页面底部引入 Google Analytics 插件。注释部分是插件信息，可以根据需要修改。当然，将 add_action 函数中的 wp_footer 替换为 wp_head 即可实现在页面头部引用统计代码，但会拖慢页面加载速度，一般不建议采用。</p>
<p>然后，将以下统计代码保存为 google-analytics.txt：</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Google Analytics --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
var pageTracker = _gat._getTracker(&quot;UA-XXXXXX-X&quot;);
pageTracker._trackPageview();
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>其中，UA-XXXXXX-X 字符串为统计账号，需根据实际情况修改。</p>
<p>最后，将 google-analytics.php 和 google-analytics.txt 文件拷贝至 google-analytics 文件夹，并上传至插件目录，在 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 插件管理面板激活启用即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/statistics-code-of-wordpress-plugins.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>去除WordPress header 的 link 标签 rel 属性</title>
		<link>http://www.xixis.net/archives/wordpress-header-to-remove-the-link-tag-rel-attribute.html</link>
		<comments>http://www.xixis.net/archives/wordpress-header-to-remove-the-link-tag-rel-attribute.html#comments</comments>
		<pubDate>Wed, 03 Mar 2010 05:11:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[lnk]]></category>
		<category><![CDATA[rel]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/%e5%8e%bb%e9%99%a4wordpress-header-%e7%9a%84-link-%e6%a0%87%e7%ad%be-rel-%e5%b1%9e%e6%80%a7.html</guid>
		<description><![CDATA[WordPress 在 2.8 版本之后，增加了几个新的 link 标签 rel 属性，例如：

&#60;link rel=&#34;index&#34; title=&#34;Sino Blog&#34; href=&#34;http://www.sinoblog.org&#34; /&#62;
&#60;link rel=&#34;start&#34; title=&#34;Hello World&#34; href=&#34;http://www.sinoblog.org/2007/09/hello-world.html&#34; /&#62;
&#60;link rel=&#34;prev&#34; title=&#34;QQ邮箱支持域名邮箱个性化邮件服务&#34; href=&#34;http://www.sinoblog.org/2009/09/qq-domainmail.html&#34; /&#62;

如果要去掉 WordPress 博客 header 部分的这些 rel 属性，可以通过修改主题支持函数(functions.php）来实现，规则是：

remove_action&#40; $tag, $function_to_add, $priority, $accepted_args &#41;;

例如，要去掉下面的这些 link 标签：

&#60;link rel=&#34;alternate&#34; type=&#34;application/rss+xml&#34; title=&#34;WP Engineer RSS Feed&#34; href=&#34;http://www.aliyoga.com/yujia/feed/&#34; /&#62;
&#60;link rel=&#34;alternate&#34; type=&#34;application/atom+xml&#34; title=&#34;WP Engineer Atom Feed&#34; href=&#34;http://www.aliyoga.com/yujia/feed/atom/&#34; /&#62;
&#60;link rel=&#34;pingback&#34; href=&#34;http://www.aliyoga.com/yujia/xmlrpc.php&#34; /&#62;
&#60;link rel=&#34;EditURI&#34; type=&#34;application/rsd+xml&#34; title=&#34;RSD&#34; href=&#34;http://www.aliyoga.com/xmlrpc.php?rsd&#34; /&#62;
&#60;link rel=&#34;index&#34; title=&#34;WP Engineer&#34; href=&#34;http://www.aliyoga.com&#34; /&#62;
&#60;link rel=&#34;start&#34; title=&#34;Use WordPress 2.7 Offline&#34; href=&#34;http://www.aliyoga.com/shop/&#34; /&#62;
&#60;link rel=&#34;prev&#34; title=&#34;Recents Drafts All Authors&#34; href=&#34;http://www.aliyoga.com/bbs/&#34; /&#62;

分别对应的 remove_action 代码是：

remove_action&#40; 'wp_head', 'feed_links_extra', 3 &#41;; // Display the links to the ...]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 在 2.8 版本之后，增加了几个新的 link 标签 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/rel" title="显示rel的所有日志" target="_blank">rel</a></span> 属性，例如：</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;"><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/rel" title="显示rel的所有日志" target="_blank">rel</a></span></span>=<span style="color: #ff0000;">&quot;index&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Sino Blog&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sinoblog.org&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Hello World&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sinoblog.org/2007/09/hello-world.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;prev&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;QQ邮箱支持域名邮箱个性化邮件服务&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.sinoblog.org/2009/09/qq-domainmail.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>如果要去掉 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 博客 header 部分的这些 rel 属性，可以通过修改主题支持函数(functions.php）来实现，规则是：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">remove_action<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tag</span><span style="color: #339933;">,</span> <span style="color: #000088;">$function_to_add</span><span style="color: #339933;">,</span> <span style="color: #000088;">$priority</span><span style="color: #339933;">,</span> <span style="color: #000088;">$accepted_args</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>例如，要去掉下面的这些 link 标签：</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;alternate&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;application/rss+xml&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;WP Engineer RSS Feed&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com/yujia/feed/&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;alternate&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;application/atom+xml&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;WP Engineer Atom Feed&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com/yujia/feed/atom/&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;pingback&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com/yujia/xmlrpc.php&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;EditURI&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;application/rsd+xml&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;RSD&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com/xmlrpc.php?rsd&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;index&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;WP Engineer&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Use WordPress 2.7 Offline&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com/shop/&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;prev&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Recents Drafts All Authors&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://www.aliyoga.com/bbs/&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>分别对应的 remove_action 代码是：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'feed_links_extra'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Display the links to the extra feeds such as category feeds</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'feed_links'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Display the links to the general feeds: Post and Comment Feed</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rsd_link'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Display the link to the Really Simple Discovery service endpoint, EditURI link</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wlwmanifest_link'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Display the link to the Windows Live Writer manifest file.</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'index_rel_link'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// index link</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'parent_post_rel_link'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// prev link</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'start_post_rel_link'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// start link</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'adjacent_posts_rel_link'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Display relational links for the posts adjacent to the current post.</span>
remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_generator'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Display the XHTML generator that is generated on the wp_head hook, WP version</span></pre></div></div>

<p>在一个老外的博客看到的，记录一下<br />
本文来源于Sino Blog http://www.sinoblog.org , 原文地址： http://www.sinoblog.org/2009/09/cleanup-wordpress-header-link-rel.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-header-to-remove-the-link-tag-rel-attribute.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让Wordpress等程序使用Dreamhost主机的统计功能</title>
		<link>http://www.xixis.net/archives/wordpress-and-other-procedures-for-the-use-of-statistical-functions-dreamhost-hosts.html</link>
		<comments>http://www.xixis.net/archives/wordpress-and-other-procedures-for-the-use-of-statistical-functions-dreamhost-hosts.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 15:23:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[网络资源]]></category>
		<category><![CDATA[Dreamhost]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/%e8%ae%a9wordpress%e7%ad%89%e7%a8%8b%e5%ba%8f%e4%bd%bf%e7%94%a8dreamhost%e4%b8%bb%e6%9c%ba%e7%9a%84%e7%bb%9f%e8%ae%a1%e5%8a%9f%e8%83%bd.html</guid>
		<description><![CDATA[使用Dreamhost的主机，可以享受其强大的统计服务，而不必在网页上添加任何代码，只需要访问yoursite.com/stats/即可查看网站统计记录。但是对于使用wordpress等程序的用户，会返回404错误，是由于wordpress程序本身干扰了转址。
其实我们只需要在站点根目录的.htaccess 里添加如下代码到# BEGIN WordPress 字段之前，就可以使其工作。
 

# BEGIN Dreamhost Stats      &#60;IfModule mod_rewrite.c&#62;       RewriteEngine On       RewriteBase /       RewriteCond %{REQUEST_URI} ^/(stats&#124;failed_auth\.html).*$ [NC]       RewriteRule . &#8211; [L]       &#60;/IfModule&#62;       # END Dreamhost Stats

]]></description>
			<content:encoded><![CDATA[<p>使用<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/dreamhost" title="显示Dreamhost的所有日志" target="_blank">Dreamhost</a></span>的主机，可以享受其强大的统计服务，而不必在网页上添加任何代码，只需要访问yoursite.com/stats/即可查看网站统计记录。但是对于使用wordpress等程序的用户，会返回404错误，是由于wordpress程序本身干扰了转址。</p>
<p>其实我们只需要在站点根目录的.htaccess 里添加如下代码到# BEGIN <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 字段之前，就可以使其工作。</p>
<p> <span id="more-387"></span><br />
<blockquote>
<p># BEGIN <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/dreamhost" title="显示Dreamhost的所有日志" target="_blank">Dreamhost</a></span> Stats      <br />&lt;IfModule mod_rewrite.c&gt;       <br />RewriteEngine On       <br />RewriteBase /       <br />RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]       <br />RewriteRule . &#8211; [L]       <br />&lt;/IfModule&gt;       <br /># END <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/dreamhost" title="显示Dreamhost的所有日志" target="_blank">Dreamhost</a></span> Stats</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-and-other-procedures-for-the-use-of-statistical-functions-dreamhost-hosts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress 友情链接随机、分列显示</title>
		<link>http://www.xixis.net/archives/link-wordpress-random-sub-column-shows-the.html</link>
		<comments>http://www.xixis.net/archives/link-wordpress-random-sub-column-shows-the.html#comments</comments>
		<pubDate>Tue, 16 Feb 2010 19:20:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[分列]]></category>
		<category><![CDATA[友情链接]]></category>
		<category><![CDATA[随机]]></category>

		<guid isPermaLink="false">http://www.xixis.net/archives/wordpress-%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5%e9%9a%8f%e6%9c%ba%e3%80%81%e5%88%86%e5%88%97%e6%98%be%e7%a4%ba.html</guid>
		<description><![CDATA[高手可以绕道了，呵呵！最近有不少人问到博客首页两列的随机友情链接是如何实现的，想想干脆写出来，大家看一下就明白了。当然你也可以用后台的 Widgets 来实现，但明显 Widgets 可操作性不强，无法控制显示几个，随着链接的越来越多，看着那么多的链接会比较的头疼。  另外如果你是用 iNove 的话，我的建议是你不要启用任何的 Widgets ，因为侧边栏的调用函数作者已经写好了，而且我认为非常的合理，如首页调用随机文章，文章页调用最新文章等等。像我现在的主题就是0个Widgets，然后另外自己加了一个友情链接的函数而已。  其实随机友链的实现也非常的简单，调用一个 wordpress 的 wp_list_bookmarks 函数，然后用几行 CSS 控制样式实现两列显示就可以了！  那么首先介绍一下 wp_list_bookmarks 这个函数：函数基本调用方式如下：

&#60;?php wp_list_bookmarks&#40;&#41;; ?&#62;

默认情况下会显示全部的链接，当然函数中还有很多的参数以供我们使用，如 orderby （链接排序方式），limit（最多显示几个链接），具体可以参考官方的说明文档。也可以去参考下：wp_list_bookmarks 函数详解。
那么我们今天介绍的只要用到几个参数就可以了，其余的都默认就OK！我是这样写的：

&#60;?php wp_list_bookmarks&#40;'title_li=&#38;categorize=0&#38;orderby=rand&#38;limit=16'&#41;; ?&#62;

这样就用列表的方式调用了没有标题的16个随机的友情链接，你可以根据自己的情况进行修改。当然你还要根据自己的皮肤情况，添加到皮肤的 sidebar.php 文件中。
只需要去找一下 sidebar.php 文件的规律，或者复制一个已经写好的模块，把其中的函数和标题替换了就OK！我是这样添加的：

&#60;div class=&#34;widget&#34;&#62;
&#60;h3&#62;Links&#60;/h3&#62;
&#60;div class=&#34;content&#34; id=&#34;links&#34;&#62;
&#60;ul&#62;&#60;?php wp_list_bookmarks&#40;'title_li=&#38;categorize=0&#38;orderby=rand&#38;limit=16'&#41;; ?&#62;&#60;/ul&#62;&#60;div id=&#34;morelink&#34;&#62;&#60;a href=&#34;http://www.xiaorsz.com/friend-link/&#34;&#62;more&#38;raquo;&#60;/a&#62;&#60;/div&#62;&#60;div class=&#34;fixed&#34;&#62;&#60;/div&#62;
&#60;/div&#62;
&#60;/div&#62;

当然，其中除了添加相当的函数外，我还添加了 more 的链接，用于显示所有的链接，修改为你自己的链接页面就行了。还为相应的 div 添加了 ID ，便于在 CSS 中进行控制。结合自己的模版添加到对应的位置就可以了！
另外如果你不想在所有的页面都显示，而只想在首页显示的话只需用 wp 的函数判断一下：

&#60;?php if &#40; is_home&#40;&#41; &#41; &#123; ?&#62;
&#60;div class=&#34;widget&#34;&#62;
&#60;h3&#62;Links&#60;/h3&#62;
&#60;div class=&#34;content&#34; id=&#34;links&#34;&#62;
&#60;ul&#62;&#60;?php wp_list_bookmarks&#40;'title_li=&#38;categorize=0&#38;orderby=rand&#38;limit=16'&#41;; ?&#62;&#60;/ul&#62;&#60;div id=&#34;morelink&#34;&#62;&#60;a href=&#34;http://www.xiaorsz.com/friend-link/&#34;&#62;more&#38;raquo;&#60;/a&#62;&#60;/div&#62;&#60;div class=&#34;fixed&#34;&#62;&#60;/div&#62;
&#60;/div&#62;
 &#60;/div&#62;&#60;?php &#125; ?&#62;

我加了 if ( is_home() ) 的判断条件，即如果是首页的话才会显示如下的代码，其它页刚不会显示。当然扩展一下还有如：is_single() 文章页，is_page() Pages页，is_category() 存档页等，可以进行非常详细的控制。具体可参考官方文档。
现在就可以在首页随机显示16个链接了，但并没有分两行显示，这时就要用到强大的CSS来控制了。在你的 style.css 文件中添加如下样式：

#links li &#123;
background:transparent none repeat scroll 0 50%;
float:left;
padding-left:0;
width:50%;
&#125;
#links li a&#123;
background:transparent url&#40;img/icons.gif&#41; no-repeat ...]]></description>
			<content:encoded><![CDATA[<p>高手可以绕道了，呵呵！最近有不少人问到博客首页两列的<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e9%9a%8f%e6%9c%ba" title="显示随机的所有日志" target="_blank">随机</a></span><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5" title="显示友情链接的所有日志" target="_blank">友情链接</a></span>是如何实现的，想想干脆写出来，大家看一下就明白了。当然你也可以用后台的 Widgets 来实现，但明显 Widgets 可操作性不强，无法控制显示几个，随着链接的越来越多，看着那么多的链接会比较的头疼。<br />  另外如果你是用 iNove 的话，我的建议是你不要启用任何的 Widgets ，因为侧边栏的调用函数作者已经写好了，而且我认为非常的合理，如首页调用<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e9%9a%8f%e6%9c%ba" title="显示随机的所有日志" target="_blank">随机</a></span>文章，文章页调用最新文章等等。像我现在的主题就是0个Widgets，然后另外自己加了一个<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5" title="显示友情链接的所有日志" target="_blank">友情链接</a></span>的函数而已。<br /> <span id="more-386"></span> 其实随机友链的实现也非常的简单，调用一个 wordpress 的 wp_list_bookmarks 函数，然后用几行 CSS 控制样式实现两列显示就可以了！<br />  那么首先介绍一下 wp_list_bookmarks 这个函数：函数基本调用方式如下：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_bookmarks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>默认情况下会显示全部的链接，当然函数中还有很多的参数以供我们使用，如 orderby （链接排序方式），limit（最多显示几个链接），具体可以参考官方的<a href="http://codex.wordpress.org/wp_list_bookmarks" target="_blank">说明文档</a>。也可以去参考下：<a href="http://www.slyar.com/blog/wp-list-bookmarks.html" target="_blank">wp_list_bookmarks 函数详解</a>。</p>
<p>那么我们今天介绍的只要用到几个参数就可以了，其余的都默认就OK！我是这样写的：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_bookmarks<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;categorize=0&amp;orderby=rand&amp;limit=16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这样就用列表的方式调用了没有标题的16个随机的友情链接，你可以根据自己的情况进行修改。当然你还要根据自己的皮肤情况，添加到皮肤的 sidebar.php 文件中。</p>
<p>只需要去找一下 sidebar.php 文件的规律，或者复制一个已经写好的模块，把其中的函数和标题替换了就OK！我是这样添加的：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;widget&quot;&gt;
&lt;h3&gt;Links&lt;/h3&gt;
&lt;div class=&quot;content&quot; id=&quot;links&quot;&gt;
&lt;ul&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_bookmarks<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;categorize=0&amp;orderby=rand&amp;limit=16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/ul&gt;&lt;div id=&quot;morelink&quot;&gt;&lt;a href=&quot;http://www.xiaorsz.com/friend-<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/link" title="显示link的所有日志" target="_blank">link</a></span>/&quot;&gt;more&amp;raquo;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;fixed&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>当然，其中除了添加相当的函数外，我还添加了 more 的链接，用于显示所有的链接，修改为你自己的链接页面就行了。还为相应的 div 添加了 ID ，便于在 CSS 中进行控制。结合自己的模版添加到对应的位置就可以了！</p>
<p>另外如果你不想在所有的页面都显示，而只想在首页显示的话只需用 wp 的函数判断一下：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;widget&quot;&gt;
&lt;h3&gt;Links&lt;/h3&gt;
&lt;div class=&quot;content&quot; id=&quot;links&quot;&gt;
&lt;ul&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_bookmarks<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;categorize=0&amp;orderby=rand&amp;limit=16'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/ul&gt;&lt;div id=&quot;morelink&quot;&gt;&lt;a href=&quot;http://www.xiaorsz.com/friend-<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/link" title="显示link的所有日志" target="_blank">link</a></span>/&quot;&gt;more&amp;raquo;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;fixed&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
 &lt;/div&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>我加了 if ( is_home() ) 的判断条件，即如果是首页的话才会显示如下的代码，其它页刚不会显示。当然扩展一下还有如：is_single() 文章页，is_page() Pages页，is_category() 存档页等，可以进行非常详细的控制。具体可参考官方文档。</p>
<p>现在就可以在首页随机显示16个链接了，但并没有分两行显示，这时就要用到强大的CSS来控制了。在你的 style.css 文件中添加如下样式：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#links</span> li <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #3333ff;">:<span style="color: #993333;">transparent</span> </span>none <span style="color: #993333;">repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;"><span style="color: #cc66cc;">50</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">50</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#links</span> li a<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #3333ff;">:<span style="color: #993333;">transparent</span> </span>url<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">img/icons.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-320px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">22px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#morelink</span> a
<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>当然，这是根据我自己的情况添加的，关键的就两个属性，一个是让 li float:left ，即左浮动，另外一个就是 width:50% ，让每个 li 占一半的宽度，很明显就是两列了，当然你也可以设置成25%，然后就是四列了！！然后又让 morelink 也就是那个 more 右浮动，它就靠右对齐了。</p>
<p>转自：http://www.xiaorsz.com/wordpress-random-link-2-row-shows/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/link-wordpress-random-sub-column-shows-the.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Optimization Bible</title>
		<link>http://www.xixis.net/archives/wordpress-optimization-bible.html</link>
		<comments>http://www.xixis.net/archives/wordpress-optimization-bible.html#comments</comments>
		<pubDate>Fri, 12 Feb 2010 14:47:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[optimaization]]></category>
		<category><![CDATA[网站优化]]></category>
		<category><![CDATA[网站加速]]></category>

		<guid isPermaLink="false">http://www.xixis.net/wordpress/wordpress-optimization-bible/</guid>
		<description><![CDATA[Foward from:http://www.prelovac.com/vladimir/wordpress-optimization-guide
by Prelovac
This WordPress optimization tutorial is the most comprehensive guide to WordPress optimization created as a huge collection of tips on how to speed up your WordPress site.
If you ever experienced slow WordPress admin panel, &#34;MySQL server has gone away&#34; message, pages taking forever to load or you want to prepare your site for a major increase in traffic (for example Digg front page) this is the guide for you.
 
1. Check the Site stats
Most commonly the problem with slow loading sites is just the sheer size of the ...]]></description>
			<content:encoded><![CDATA[<p>Foward from:<a title="http://www.prelovac.com/vladimir/wordpress-optimization-guide" href="http://www.prelovac.com/vladimir/wordpress-optimization-guide">http://www.prelovac.com/vladimir/wordpress-optimization-guide</a></p>
<p>by Prelovac</p>
<p>This <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> optimization tutorial is the most comprehensive guide to <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> optimization created as a huge collection of tips on how to speed up your WordPress site.</p>
<p>If you ever experienced slow WordPress admin panel, &quot;MySQL server has gone away&quot; message, pages taking forever to load or you want to prepare your site for a major increase in traffic (for example Digg front page) this is the guide for you.</p>
<p> <span id="more-380"></span><br />
<h5>1. Check the Site stats</h5>
<p>Most commonly the problem with slow loading sites is just the sheer size of the page. A typical webpage today will be loaded with images, flash, videos and javascripts all which take a significant portion of bandwidth.</p>
<p>If you want to start dealing with this issue seriously you need to get <a href="http://www.mozilla.com/firefox/">Firefox </a>browser, <a href="http://www.getfireug.com">Firebug </a>extension and <a href="http://developer.yahoo.com/yslow/">Yslow </a>plugin.</p>
<p>Yslow module will allow you to get a performance score from 0-100.&#160; Getting your site to 80+ score should be your aim.</p>
<p>Try to keep your page size under 100KB. Try to keep it under 50kb if possible. If you have a lot of multimedia content then by all means learn to use YSlow.</p>
<blockquote><p><a href="http://developer.yahoo.com/performance/rules.html">Learn</a> about ways to improve the page loading speed.</p>
</blockquote>
<p>Another useful Firefox extension worth checking out is Google&#8217;s <a href="http://code.google.com/speed/page-speed/">Page Speed</a>.</p>
<h5>2. Check your (Vista) System</h5>
<p>In rare occasions when you are loading your and other sites slowly, it can be your Vista system that is causing the slowdown.</p>
<blockquote><p>If you are running Vista <a href="http://itsvista.com/2007/02/itsvista-tip-37-why-certain-web-sites-are-slow-in-vista/">check this article</a> for a diagnosis and a possible solution.</p>
</blockquote>
<h5>3. Check the Plugins</h5>
<p>Plugins are usually the prime suspect for slowdowns. With so many WordPress plugins around, chance is you might have installed a plugin which does not use the resources in an optimum way.</p>
<p>For example such plugins that caused slowdowns in the past have been <a href="http://mylifethinking.com/life/is-your-wordpress-blog-too-slow/">Popularity contest</a>, <a href="http://www.popularwealth.com/index.php/wordpress-admin-panel-slow">aLinks</a> or <a href="http://www.groovypost.com/blogs/mrgroove/wordpress/fix-for-slow-wordpress-admin-pages/">@Feed</a>.</p>
<blockquote><p>To check plugins, deactivate all of them and check the critical areas of the site again. If everything runs OK, re-enable the plugins one by one until you find the problematic plugin.</p>
</blockquote>
<p>After finding the cause you can either write a message to the plugin author and hope they fix it or search for an alternative.</p>
<h5>4. Check your Theme</h5>
<p>If it&#8217;s not the plugins, and you are troubleshooting slowdown of the site, you should check it with a different theme.</p>
<p>Themes can include code with plugin capabilities inside the theme&#8217;s <em>function.php</em> file so everything what applies to plugins can apply to the theme.</p>
<p>Also, themes may use excessive JavaScript or image files, causing slow loading of the page because of huge amount of data to transfer and/or number of http requests used.</p>
<blockquote><p>WordPress comes installed with a default theme and it&#8217;s best used to test the site if your theme is the suspect for poor performance.</p>
</blockquote>
<p>If you discover your theme is causing the slowdowns, you can use the excellent Firebug tool for Firefox browser to debug the problem. Learn more about <a href="http://getfirebug.com/">Firebug</a>, your new best friend.</p>
<p>You can also use <a href="http://www.websiteoptimization.com/services/analyze/">this site</a> get general information about the site very fast.</p>
<h5>5. Optimize Database Tables</h5>
<p>Database tables should be periodically optimized (and repaired if necessary) for optimum performance.</p>
<blockquote><p>I recommend using <a href="http://lesterchan.net/portfolio/programming/php/">WP-DBManager</a> plugin which provides this functionality as well as database backup, all crucial for any blog installation.</p>
</blockquote>
<p>WP-DBManager allows you to schedule and forget, and it will take care of all the work automatically.</p>
<p>Other alternative is manually optimizing and repairing your table through a tool like phpmyadmin.</p>
<h5>6. Turn off Post Revisions</h5>
<p>With WordPress 2.6, post version tracking mechanism was introduced. For example, every time you &quot;Save&quot; a post, a revision is written to the database. If you do not need this feature you can easily turn it off by adding one line to your <em>wp-config.php</em> file, found in the installation directory of your WordPress site:</p>
<blockquote><p>define(&#8216;WP_POST_REVISIONS&#8217;, false);</p>
</blockquote>
<p>If you have run a blog with revisions turned on for a while, chance is you will have a lot of revision posts in your database. if you wish to remove them for good, simply run this query (for example using the mentioned WP-DBManager) plugin.</p>
<blockquote><p>DELETE FROM wp_posts WHERE post_type = &quot;revision&quot;;</p>
</blockquote>
<p>This will remove all &quot;revision&quot; posts from your database, making it smaller in the process.</p>
<p><strong>NOTE: </strong>Do this with care. If you are not sure what you are doing, make sure to at least create a backup of the database first or even better, ask a professional to help you.</p>
<h5>7. Implement Caching</h5>
<p>Caching is a method of retrieving data from a ready storage (cache) instead of using resources to generate it every time the same information is needed. Using cache is much faster way to retrieve information and is generally recommended practice for most modern applications.</p>
<p>The easiest way to implement caching (and usually the only way if your blog is on shared hosting) is to use a caching plugin.</p>
<p>The most commonly used is <a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a>.</p>
<p>A new kid on the block, <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a> is more powerful alternative, maturing with every day.</p>
<h5>8. MySQL Optimization</h5>
<p>MySQL can save the results of a query in it&#8217;s own cache. To enable it edit the MySQL configuration file (usually <strong>/etc/my.cnf)</strong> and add these lines:</p>
<blockquote><p>query_cache_type = 1     <br />query_cache_limit = 1M      <br />query_cache_size = 16M</p>
</blockquote>
<p>This will create a 16 MB query cache after you restart the MySQL server (the amount depends on the amount of available RAM, I use around 250MB on 4GB machine).</p>
<p>To check if it is properly running, run this query:</p>
<blockquote><p>SHOW STATUS LIKE &#8216;Qcache%&#8217;;</p>
</blockquote>
<p>Example result:</p>
<blockquote><p>&#160;</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="200">Qcache_free_blocks</td>
<td valign="top" width="200">718</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_free_memory</td>
<td valign="top" width="200">13004008</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_hits</td>
<td valign="top" width="200">780759</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_inserts</td>
<td valign="top" width="200">56292</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_lowmem_prunes</td>
<td valign="top" width="200">0</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_not_cached</td>
<td valign="top" width="200">3711</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_queries_in_cache</td>
<td valign="top" width="200">1715</td>
</tr>
<tr>
<td valign="top" width="200">Qcache_total_blocks</td>
<td valign="top" width="200">4344</td>
</tr>
</tbody>
</table>
</blockquote>
<h6>Further MySQL Optimization:</h6>
<p>There a lot of options you can play with so here is my MySQL config file instead, tuned in for 4GB, quad-core dedicated machine. This will most probably not work for your machine out of box, use it just as a general guideline.</p>
<blockquote><p>[mysqld]     <br />bulk_insert_buffer_size = 8M      <br />connect_timeout=10      <br />interactive_timeout=50      <br />join_buffer=1M      <br />key_buffer=250M      <br />max_allowed_packet=16M      <br />max_connect_errors=10      <br />max_connections=100      <br />max_heap_table_size = 32M      <br />myisam_sort_buffer_size=96M      <br />query_cache_limit = 4M      <br />query_cache_size = 250M      <br />query_cache_type = 1      <br />query_prealloc_size = 65K      <br />query_alloc_block_size = 128K      <br />read_buffer_size=1M      <br />read_rnd_buffer_size=768K      <br />record_buffer=1M      <br />safe-show-database      <br />skip-innodb      <br />skip-locking      <br />skip-networking      <br />sort_buffer=1M      <br />table_cache=4096      <br />thread_cache_size=1024      <br />thread_concurrency=8      <br />tmp_table_size = 32M      <br />wait_timeout=500</p>
<p># for slow queries, comment when not used     <br />#log-slow-queries=/var/log/mysql-slow.log      <br />#long_query_time=1      <br />#log-queries-not-using-indexes</p>
<p>[mysqld_safe]     <br />nice = -5      <br />open_files_limit = 8192</p>
<p>[mysqldump]     <br />quick      <br />max_allowed_packet = 16M</p>
<p>[myisamchk]     <br />key_buffer = 64M      <br />sort_buffer = 64M      <br />read_buffer = 16M      <br />write_buffer = 16M</p>
</blockquote>
<p><strong>Tip #2:</strong>    <br />Here is a <a href="http://www.hopelessgeek.com/2006/03/21/optimizing-a-vps-for-getting-dugg">further read</a> regarding MySQL optimization and another one <a href="http://www.interworx.com/forums/showthread.php?p=2346">here</a>.</p>
<p>Extremely useful <a href="http://hackmysql.com/mysqlreport">mysqlrepot</a> tool will help you tweak that mysql like nothing. <a href="http://wiki.mysqltuner.com/MySQLTuner">Mysql tuner</a> is one of the best and quickest tools out there to tell you how can you fix up your database. <a href="http://www.day32.com/MySQL/">MySQL Tuning primer</a> and <a href="http://gert.sos.be/en/">MySQL Activity Report</a> are another two scripts to try out.</p>
<p><a href="http://www.maatkit.org/">Maatkit</a> is an extremely useful toolkit for managing MySQL.</p>
<p>MySQL slow query log is valuable for getting info about most problematic queries. To activate it you can edit your my.cnf</p>
<blockquote><p>log-slow-queries=/var/log/mysql-slow.log     <br />long_query_time=1      <br />log-queries-not-using-indexes</p>
</blockquote>
<p>This will create a log of slow queries and those not using indexes. Now you need to be able to <a href="http://www.ducea.com/2006/11/06/identifying-mysql-slow-queries/">identify</a> the slow ones for which you can use external <a href="http://www.mysqlperformanceblog.com/2006/09/06/slow-query-log-analyzes-tools/">slow log filter and parsing</a> <a href="http://hackmysql.com/mysqlsla">tools</a>. Using &#8216;<a href="http://dev.mysql.com/doc/refman/5.0/en/using-explain.html">EXPLAIN</a>&#8216; is an effective way to understand and optimize complex queries.</p>
<p>You can also install <a href="http://jeremy.zawodny.com/mysql/mytop/">mytop</a>, a &#8216;top&#8217; command clone that works with MySQL.</p>
<h5>9. PHP Opcode Cache</h5>
<p>PHP is interpreted language, meaning that every time PHP code is started, it is compiled into the so called op-codes, which are then run by the system. This compilation process can be cached by installing an opcode cache such as <a href="http://eaccelerator.net/">eAccelerator</a>. There are <a href="http://en.wikipedia.org/wiki/Alternative_PHP_Cach">other caching solutions out there</a> as well.</p>
<p>To install eAccelerator, unpack the archive and go to the eAccelerator folder. Then type:</p>
<blockquote><p>phpize     <br />./configure      <br />make      <br />make install</p>
</blockquote>
<p>This will install eAccelerrator.</p>
<p>Next create temp folder for storage:</p>
<blockquote><p>mkdir /var/cache/eaccelerator</p>
<p>chmod 0777 /var/cache/eaccelerator</p>
</blockquote>
<p>Finally to enable it, add these lines to the end of your php.ini file (usually <strong>/etc/php.ini</strong> or <strong>/usr/lib/php.ini</strong>):</p>
<blockquote><p>extension=&quot;eaccelerator.so&quot;     <br />eaccelerator.shm_size=&quot;16&quot;      <br />eaccelerator.cache_dir=&quot;/var/cache/eaccelerator&quot;      <br />eaccelerator.enable=&quot;1&quot;      <br />eaccelerator.optimizer=&quot;1&quot;      <br />eaccelerator.check_mtime=&quot;1&quot;      <br />eaccelerator.debug=&quot;0&quot;      <br />eaccelerator.filter=&quot;&quot;      <br />eaccelerator.shm_max=&quot;0&quot;      <br />eaccelerator.shm_ttl=&quot;0&quot;      <br />eaccelerator.shm_prune_period=&quot;0&quot;      <br />eaccelerator.shm_only=&quot;0&quot;      <br />eaccelerator.compress=&quot;1&quot;      <br />eaccelerator.compress_level=&quot;9&quot;</p>
</blockquote>
<p>The changes will be noticeable at once, as PHP does not need to be &#8216;restarted&#8217;.</p>
<p><strong>Note #1:</strong> WP Super Cache and eAccelerator work <a href="http://blog.sweetnam.eu/2007/11/07/supercache-eaccelerator-and-wordpress-benchmarks/">fine together</a> showing further increase in performance.</p>
<p><strong>Note #2:</strong> If you like even more possibility for performance, check the <a href="http://murmatrons.armadillo.homeip.net/features/experimental-eaccelerator-wp-super-cache">WP Super Cache and eAccelerator plugin</a>.</p>
<p><strong>Note #3:</strong> Unfortunately eAccelerator won&#8217;t work if PHP is run as CGI. You can try <a href="http://morph3ous.net/2006/08/03/suexec-php-514-fastcgi-and-cpanel/">using fastcgi</a> which will work with suExec and eAccelerator.</p>
<p><strong>Note #4:</strong>W3 Total Cache mentioned earlier already utilities both memcached and APC making it amazingly fast.</p>
<h5>10. Web Server optimization</h5>
<p>Apache optimization is something books have been written on so I will first forward you to this article <a href="http://httpd.apache.org/docs/1.3/misc/perf-tuning.html">here</a>. Indepth apache compilation tips <a href="http://tldp.org/LDP/LGNET/123/vishnu.html">here</a>, performance tuning <a href="http://www.devside.net/articles/apache-performance-tuning">here</a>, VPS tips <a href="http://www.agnivo.com/tech/vps-mysql-and-apache-optimization-guide-27.html">here </a>and keep alive tips <a href="http://virtualthreads.blogspot.com/2006/01/tuning-apache-part-1.html">here</a>.</p>
<p>You can easily test changes in your configuration by running a test from your command prompt</p>
<blockquote><p>ab -t30 -c5 http://www.mysite.com/</p>
</blockquote>
<p>and comparing results. I get around 200 req/s on VPS server.</p>
<p>For more flexible testing you can use <a href="http://www.xenoclast.org/autobench/">Autobench </a>which works in conjunction with <a href="http://www.hpl.hp.com/research/linux/httperf/">httperf</a>, another benchmarking tool.</p>
<p>Use a fast web server like <a href="http://nginx.net/">nginx</a> to serve static content (ie. images) while passing dynamic requests is another <a href="http://intranation.com/entries/2008/09/using-nginx-reverse-proxy/">popular</a> <a href="http://www.hostmedic.com/admin/network_administration/nginx-apache-happy-fast-cpanel-server/">technique</a> <a href="http://figvam.blogspot.com/2008/05/using-nginx-to-accelerate-apache-on.html">you</a> <a href="http://www.mr-san.com/nginx-reverse-proxy-load-balance/">can</a> <a href="http://articles.slicehost.com/2007/12/3/ubuntu-gutsy-adding-an-nginx-init-script">use</a> to improve <a href="https://calomel.org/nginx.html">performance</a>.</p>
<p><strong>Note #1:</strong> More cool resources. <a href="http://www.die.net/musings/page_load_time/">Optimizing Page load time</a> and a great <a href="http://newestindustry.org/2006/08/30/web-performance-part-i-fundamentals/">series on website performance</a>.</p>
<p><strong>Note #2:</strong> You can find even more tips&amp;tricks on <a href="http://elliottback.com/wp/why-my-wordpress-site-is-so-much-faster-than-yours/">Elliot Back&#8217;s</a> site</p>
<h5>11. &quot;MySQL server has gone away&quot; workaround</h5>
<p>This WordPress database error appears on certain configurations and it manifests in very slow and no response, usually on your admin pages.</p>
<blockquote><p>Workaround for this MySQL problem has been best addressed <a href="http://robsnotebook.com/wordpress-mysql-gone-away">in this article</a>.</p>
</blockquote>
<p>This problem evidently exists, but the suggested fix is valid only until you upgrade your WordPress. Hopefully it will be further researched and added into the WordPress core in the future.</p>
<p><strong>Note #1:</strong> Sometimes increasing MySQL wait_timeout to 1000 will help with this issue.</p>
<h5>12. Fixing posting not possible problem</h5>
<p>If you experience WordPress admin panel crawling to a halt, with inability to post or update certain posts, you are probably hitting the mod_security wall.</p>
<p>ModSecurity is Apache module for increasing web site security by preventing system intrusions. However, sometimes it may decide that your perfectly normal WordPress MySQL query is trying to do something suspicious and black list it, which manifests in very slow or no response of the site.</p>
<p>To test if this is the case, check your Apache error log, for example:</p>
<blockquote><p>tail -f /usr/local/apache/logs/error_log</p>
</blockquote>
<p>and look for something like this:</p>
<blockquote><p><strong>ModSecurity: Access denied with code 500</strong> (phase 2) &#8230; [<strong>id &quot;300013&quot;</strong>] [rev &quot;1&quot;] [msg &quot;<strong>Generic SQL injection protection</strong>&quot;] [severity &quot;CRITICAL&quot;] [hostname&#160; www.prelovac.com&quot;] [<strong>uri &quot;/vladimir/wp-admin/page.php&quot;</strong></p>
</blockquote>
<p>It tells you the access for this page was denied because of a security rule with id 300013. Fixing this includes white-listing this rule for the page in question.</p>
<p>To do that, edit apache config file (for example <strong>/usr/local/apache/conf/modsec2/exclude.conf</strong>) and add these lines:</p>
<blockquote><p>SecRuleRemoveById 300013</p>
</blockquote>
<p>This will white list the page for the given security rule and your site will continue to work normally.</p>
<h5>13. RSS Pings and Pingbacks</h5>
<p>Reasons for slow WordPress posting may include rss ping and pingback timeouts.</p>
<p>By default WordPress will try to ping servers listed in your <a href="http://www.prelovac.com/vladimir/wordpress-ping-list">ping list</a> (found in <strong>Settings-&gt;Writing </strong>panel) and one of them may timeout slowing the entire process.</p>
<p>Second reason are post pingbacks, mechanism in which WordPress notifies the sites you linked to in your article. You can disable pingbacks in <strong>Settings-&gt;Discussion</strong> by un-checking option &quot;<strong>Attempt to notify any blogs linked to from the article (slows down posting)</strong>&quot;.</p>
<blockquote><p>Try clearing ping list and disabling pingbacks to see if that helps speed up your posting time.</p>
</blockquote>
<h5>Following are the general Rules for optimizing page loading time</h5>
<h5>14. Use subdomains to share the load</h5>
<p>Most browsers are set to load 2-4 files from a domain in parallel. If you move some files to a different domain (subdomain will work) the browser will start downloading 2-4 more files in parallel.</p>
<p>It is good idea to move your theme image files to a subdomain you create. I have created demo.prelovac.com/images and moved my theme images there. I have then changed the theme style.css to reflect the full url to the new image files. Job done!</p>
<h5>15. Minimize the number of HTTP requests</h5>
<p>You can lower the number of HTTP requests by using fewer images (or placing all images in one large image and position them with CSS), fewer javascripts, fewer css files (usually meaning fewer plugins).</p>
<p>Good effort has been made by <a href="http://aciddrop.com/php-speedy/">PHP speedy plugin</a> which will merge all your JavaScript and all CSS files in one big file which really helps in lowering the HTTP request numbers. The biggest drawback of PHP Speedy is that it&#8217;s not 100% compatible with all plugins.</p>
<p>Also use the <a href="http://www.csssprites.com/">CSS Sprite generator</a> to move all your images into one image and then use CSS background-position to display them. This will cut your number of HTTP requests significantly.</p>
<h5>16. Compress the content using apache .htaccess</h5>
<p>If you have our own server you can chose to gzip all content sent to browsers. This will lower the loading time significantly as most html pages compress very well.</p>
<p>Add this code to your .htaccess</p>
<blockquote><p>AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript application/x-httpd-php application/rss+xml application/atom_xml text/javascript</p>
</blockquote>
<h5>17. Create expires headers</h5>
<p>Expire headers tell the browser how long it should keep the content in cache. Most of the images on your site never change and it is good idea to keep them cached locally.</p>
<p>Here is a <a href="http://www.askapache.com/htaccess/apache-htaccess.html">recommended setting</a>:</p>
<blockquote><pre>Header unset Pragma
FileETag None
Header unset ETag&#160;&#160; # 1 YEAR

Header set Cache-Control &quot;public&quot;
Header set Expires &quot;Thu, 15 Apr 2010 20:00:00 GMT&quot;
Header unset Last-Modified&#160;&#160; # 2 HOURS

Header set Cache-Control &quot;max-age=7200, must-revalidate&quot;&#160;&#160; # CACHED FOREVER
# MOD_REWRITE TO RENAME EVERY CHANGE

Header set Cache-Control &quot;public&quot;
Header set Expires &quot;Thu, 15 Apr 2010 20:00:00 GMT&quot;
Header unset Last-Modified</pre>
</blockquote>
<p>Use <a href="http://www.ircache.net/cgi-bin/cacheability.py">cacheability engine</a> to check your cache configuration.</p>
<h5>18. Cache Gravatars</h5>
<p>Many blogs use Gravatars, the little images next to your comments. However gravatars have two big flaws in regards to site optimization:</p>
<ul>
<li>Every gravatar image is a new HTTP requests even if same image is loaded (page with 100 comments would have 100 additional HTTP requests) </li>
<li>Gravatar images do not contain expire headers</li>
</ul>
<p>What we can do is create a local gravatar cache, where images would be cached and served from our site. Ideally you would place the gravatar cache on a separate subdomain (see first heading).</p>
<p>I use a <a href="http://zenpax.com/">plugin from Zenpax.com </a>which allows all gravatars to be cached locally.</p>
<h5>19. Optimize the images with smush.it</h5>
<p>It is often overlooked that your images can be optimized (made smaller) which can significantly reduce loading times.</p>
<p>Wouldn&#8217;t it be perfect if you could open a site, press a button in your browser and get all images on the site optimized and made available in a single zip file. That is possible thanks to <a href="http://smush.it">smush.it</a> and their Firefox plugin. It is amazing how effective this is!</p>
<h5>20. CSS on top, JavaScript on bottom</h5>
<p>It is golden practice to put CSS files on top of the page so they are loaded first. JavaScript files should be placed on the <a href="http://developer.yahoo.com/performance/rules.html#js_bottom">bottom of the page</a> (when possible). I have created a simple plugin which will move the <a href="http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin">properly registered</a> JavaScript files to the bottom of your pages. The plugin is called <a href="http://www.prelovac.com/vladimir/wordpress-plugins/footer-javascript">Footer javaScript</a>.</p>
<h5>Conclusion</h5>
<p>Modern webservers and websites have grown to depend on many different factors.</p>
<p>This article covered various approaches to optimization from system level apache, PHP and MySQL changes to settings within your WordPress.</p>
<p>I hope following this guide will help you create a fast and responsive WordPress based site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-optimization-bible.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress技巧荟萃</title>
		<link>http://www.xixis.net/archives/wordpress-skills-fair.html</link>
		<comments>http://www.xixis.net/archives/wordpress-skills-fair.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 18:37:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[Slug]]></category>
		<category><![CDATA[导航]]></category>

		<guid isPermaLink="false">http://www.xixis.net/wordpress/wordpress%e6%8a%80%e5%b7%a7%e8%8d%9f%e8%90%83/</guid>
		<description><![CDATA[Wordpress最吸引我的魅力就在于她丰富多样的扩展性。只要你有丰富的知识、熟练的技术以及一个富有创造性的大脑，那么你的Wordpress博客就会变得无所不能！
&#160;&#160;&#160;&#160; 增强Wordpress扩展性大家最常用的就是插件，说实在的我不太喜欢使用过多的插件，因为当我每每添加一个插件，我就不得不考虑博客浏览的速度！我最多使用的就是Hack（我个人把它翻译为“技巧”也可以译为“修改”），那么Hack和plugin究竟有何区别呢？


Hack：是基于开源的程序的基础，是针对原程序文件的直接修改，如对其代码进行增加、删除或者修改、优化，使之在功能上符合新的需求。Hack在格式上也自然没有太严格的规定，且一般没有文件的增加。
plugin：一般是利用程序的API（接口），复用程序底层，利用一些程序既有的函数和类来制作新的小作品，一般有文件的增加。符合标准的插件，其目录结构和文件名都是有一定格式的（如Wordpress的插件文件需放在plugin目录下）。

&#160;&#160;&#160;&#160; 经常在网上浏览，你就会发现很多优秀的博客都使用到一些小技巧。我筛选一些个人认为实用性比较强的的技巧不定期的介绍给大家。如果该技巧比较复杂我会将其独立成篇；如果简单易行，则汇集若干成一篇，以便于大家阅读。
（一）给你的博客增加一个导航
给你的博客增加一个良好的导航链接，让你的读者不至于在阅读你的博客时迷失方向，那是很重要的；同时良好的导航可以指引读者在你的博客中找到更多他想要的东西。 
在single.php页面循环开始之后最开始的地方添加以下代码即可：

&#60;a href=&#34;&#60;?php echo get_settings&#40;'home'&#41;; ?&#62;&#34; title=&#34;Home&#34;&#62;Home&#60;/a&#62; &#38;raquo; &#60;?php the_category&#40;&#34;,&#34;&#41;; ?&#62;  &#38;raquo; &#60;?php the_title&#40;&#41;; ?&#62;

你还可以为它定义一个CSS样式（仅供参考）：

#postpath &#123;
	background:url&#40;images/postpath.png&#41; no-repeat 3px 3px;
	height:16px;
	line-height:16px;
	margin:5px 0;
	padding-left:22px;
&#125;

（二）在你的每个页面前三篇日志中显示Google Ads
很多网友都想在他们主页的前三篇日志中来展示Google Ads以获取更好的展示效果以及更多的点击量。下面来看看如何改造你的主题以达到此目的。打开你主题中的indexe.php文件并找到页面循环语句（the loop）。 
循环语句（the loop）开始于：

&#60;?php if &#40;have_posts&#40;&#41;&#41; : while &#40;have_posts&#40;&#41;&#41; : the_post&#40;&#41;; ?&#62;

结束于：

&#60;?php endwhile; ?&#62;

你要把你的Google Ads放置于循环语句（the loop）的开始和结束之间，选择一个适当的位置（比如文章的开头和结尾）加入如下代码：

&#60;?php if &#40;$wp_query-&#62;current_post &#60; 3&#41; &#123; ?&#62;
&#60;!-- 在这里加入你的 Google Adsense 代码 --&#62;
&#60;?php &#125; ?&#62;

保存文件，刷新一下看看是不是你想要的结果:-) 
（三）显示博客作者列表
如果你的博客是一个多用户博客，并且你想把作者以列表形式显示出来，那么一下代码将帮助到你：

&#60;ul&#62;
&#60;?php wp_list_authors&#40;'exclude_admin=0&#38;optioncount=1&#38;show_fullname=1&#38;hide_empty=1'&#41;; ?&#62;
&#60;/ul&#62;

相关参数设定： 


exclude_admin：0（列表中包括管理员的名字）/1（列表中排除管理员的名字） 
optioncount：0（在作者名字后面不显示文章数目）/1（在作者后面显示文章数目） 
show_fullname：0（只显示first name）/1（显示full name） 
hide_empty：0（没有文章的作者也显示在名单中）/1（只显示至少有一篇文章的用户） 


（四）Wordpress无法编辑分类缩略名(Slug)的解决
    前两天在写文章时想添加一个jQuery的分类，创建分类时我把分类名称和缩略名都设置成jQuery，结果发现提交以后缩略名变成了jquery-2这样的形式，当修改分类缩略名(Slug)的时候Wordpress始终提示&#34;分类未更新&#34;,亦然保持原有的缩略名。百思不得其解，最终无意在DiggLife这里找到了答案。

原因：造成无法更改分类缩略名的原因很简单,Wordpress 2.3及以上的版本由于引进了标签功能，Wordpress数据库结构发生了变化。链接分类、日志分类和标签被整合到wp_terms表中(这个页面有详细说明).由于分类缩略名必须唯一，所以如果你已经使用了某个词作为标签或者链接分类，那么你将无法将其作为分类缩略名。


解决方案：使用另外一个分类缩略名或者删除那个重复的标签。这就要看哪个损失比较小了，如果你的日志里已经多次链接到这个分类，那么最好删除或者修改标签，反之则修改分类缩略名。（这里需要再提醒一下，如果你为你的的中文标签都设置有缩略名，也要注意它们是否和你现在正在设置的分类缩略名重复）

所以，在建博初期，最好确定所有应该固定下来的链接。比如页面缩略名、分类缩略名、日志永久链接结构等。不然修改起来会非常麻烦,而且会造成不必要的损失。
（五）只针对搜索引擎显示Adsense广告
这个技巧依旧来自于DiggLife。在DiggLife的这篇文章中，以及水煮鱼的《提高Google Adsense收入的三个小技巧》中均提到这样一个观点：

长期浏览你博客的用户其实不会点击你的广告的，所以对于这部分用户显示广告是没有用的，所以最好的办法就是直接给来自搜索引擎的用户显示广告，一般来自搜索引擎的用户特别容易点击广告。所以针对搜索引擎显示Adsense广告，其目的就是为了减少无效展示，提高eCPM，也就是所谓的有效每千次展示的费用。据说eCPM高了，Adsense机器人会自动匹配高单价的广告到你的网页，所以在点击率一定的情况下，提高eCPM是是一种有效提高广告收入的办法。

那么如何只针对搜索引擎显示Adsense广告？DiggLife给出了一个比较完美的解决方案： 

&#60;?php
&#160;
$referer = $_SERVER&#91;'HTTP_REFERER'&#93;;
&#160;
$se = array&#40;'google.com/search?', 'baidu.com/s?', 'soso.com/q?'&#41;;
&#160;
$adsense = &#60;&#60;&#60;AD
&#160;
adsense代码
&#160;
AD;
&#160;
foreach &#40;$se as $source&#41; &#123;//将se数组中的每一个值逐一赋给$source
&#160;
if&#40;strpos&#40;$referer,$source&#41; !== false&#41;&#123;
&#160;
echo $adsense;
&#160;
&#125;
&#160;
&#125;
&#160;
?&#62;

如果你想了解这段代码的更多含义，以及这样写的道理，那你就不妨移步到这里慢慢看。
（六）为Feed 内容添加版权信息
在每篇博文后声明文章的版权，这是很常见的，但是它不会出现在feed订阅中。如果你是城市@后的订阅用户，你就会发现在feed输出中也会有版权的显示。那么如何给你的Feed输出文章中也加入版权声明呢？ 
很简单，只需在你的主题function.php文件的最后加入如下代码即可：

&#60;?php
&#160;
$notice = '&#60;p&#62;&#38;copy;' . ...]]></description>
			<content:encoded><![CDATA[<p>Wordpress最吸引我的魅力就在于她丰富多样的扩展性。只要你有丰富的知识、熟练的技术以及一个富有创造性的大脑，那么你的Wordpress博客就会变得无所不能！</p>
<p>&#160;&#160;&#160;&#160; 增强Wordpress扩展性大家最常用的就是插件，说实在的我不太喜欢使用过多的插件，因为当我每每添加一个插件，我就不得不考虑博客浏览的速度！我最多使用的就是Hack（我个人把它翻译为“技巧”也可以译为“修改”），那么Hack和plugin究竟有何区别呢？</p>
<p><span id="more-319"></span></p>
<blockquote>
<p><strong>Hack：</strong>是基于开源的程序的基础，是针对原程序文件的直接修改，如对其代码进行增加、删除或者修改、优化，使之在功能上符合新的需求。Hack在格式上也自然没有太严格的规定，且一般没有文件的增加。</p>
<p><strong>plugin：</strong>一般是利用程序的API（接口），复用程序底层，利用一些程序既有的函数和类来制作新的小作品，一般有文件的增加。符合标准的插件，其目录结构和文件名都是有一定格式的（如Wordpress的插件文件需放在plugin目录下）。</p>
</blockquote>
<p>&#160;&#160;&#160;&#160; 经常在网上浏览，你就会发现很多优秀的博客都使用到一些小技巧。我筛选一些个人认为实用性比较强的的技巧不定期的介绍给大家。如果该技巧比较复杂我会将其独立成篇；如果简单易行，则汇集若干成一篇，以便于大家阅读。</p>
<p><strong>（一）给你的博客增加一个<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e5%af%bc%e8%88%aa" title="显示导航的所有日志" target="_blank">导航</a></span></strong></p>
<p>给你的博客增加一个良好的<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e5%af%bc%e8%88%aa" title="显示导航的所有日志" target="_blank">导航</a></span>链接，让你的读者不至于在阅读你的博客时迷失方向，那是很重要的；同时良好的导航可以指引读者在你的博客中找到更多他想要的东西。 </p>
<p>在single.php页面循环开始之后最开始的地方添加以下代码即可：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_settings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Home&quot;&gt;Home&lt;/a&gt; &amp;raquo; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>  &amp;raquo; <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>你还可以为它定义一个CSS样式（仅供参考）：</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#postpath</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/postpath.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">22px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>（二）在你的每个页面前三篇日志中显示Google Ads</strong></p>
<p>很多网友都想在他们主页的前三篇日志中来展示<strong>Google Ads</strong>以获取更好的展示效果以及更多的点击量。下面来看看如何改造你的主题以达到此目的。打开你主题中的<strong>indexe.php</strong>文件并找到页面循环语句（the loop）。 </p>
<p>循环语句（the loop）开始于：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>结束于：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>你要把你的<strong>Google Ads</strong>放置于循环语句（the loop）的开始和结束之间，选择一个适当的位置（比如文章的开头和结尾）加入如下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">current_post</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!-- 在这里加入你的 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/google-adsense" title="显示Google Adsense的所有日志" target="_blank">Google Adsense</a></span> 代码 --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>保存文件，刷新一下看看是不是你想要的结果:-) </p>
<p><strong>（三）显示博客作者列表</strong></p>
<p>如果你的博客是一个多用户博客，并且你想把作者以列表形式显示出来，那么一下代码将帮助到你：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;ul&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_authors<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude_admin=0&amp;optioncount=1&amp;show_fullname=1&amp;hide_empty=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;</pre></div></div>

<p>相关参数设定： </p>
<blockquote>
<ul>
<li><strong>exclude_admin：</strong>0（列表中包括管理员的名字）/1（列表中排除管理员的名字） </li>
<li><strong>optioncount：</strong>0（在作者名字后面不显示文章数目）/1（在作者后面显示文章数目） </li>
<li><strong>show_fullname：</strong>0（只显示first name）/1（显示full name） </li>
<li><strong>hide_empty：</strong>0（没有文章的作者也显示在名单中）/1（只显示至少有一篇文章的用户） </li>
</ul>
</blockquote>
<p><strong>（四）Wordpress无法编辑分类缩略名(<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/slug" title="显示Slug的所有日志" target="_blank">Slug</a></span>)的解决<br />
    <br /></strong>前两天在写文章时想添加一个jQuery的分类，创建分类时我把分类名称和缩略名都设置成jQuery，结果发现提交以后缩略名变成了jquery-2这样的形式，当修改分类缩略名(<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/slug" title="显示Slug的所有日志" target="_blank">Slug</a></span>)的时候Wordpress始终提示&quot;分类未更新&quot;,亦然保持原有的缩略名。百思不得其解，最终无意在<a href="http://www.digglife.cn/">DiggLife</a>这里找到了答案。</p>
<blockquote>
<p><strong>原因：</strong>造成无法更改分类缩略名的原因很简单,Wordpress 2.3及以上的版本由于引进了标签功能，Wordpress数据库结构发生了变化。链接分类、日志分类和标签被整合到wp_terms表中(这个页面有详细说明).由于分类缩略名必须唯一，所以如果你已经使用了某个词作为标签或者链接分类，那么你将无法将其作为分类缩略名。</p>
</blockquote>
<blockquote>
<p><strong>解决方案：</strong>使用另外一个分类缩略名或者删除那个重复的标签。这就要看哪个损失比较小了，如果你的日志里已经多次链接到这个分类，那么最好删除或者修改标签，反之则修改分类缩略名。（这里需要再提醒一下，如果你为你的的中文标签都设置有缩略名，也要注意它们是否和你现在正在设置的分类缩略名重复）</p>
</blockquote>
<p>所以，在建博初期，最好确定所有应该固定下来的链接。比如页面缩略名、分类缩略名、日志永久链接结构等。不然修改起来会非常麻烦,而且会造成不必要的损失。</p>
<p><strong><strong>（五）</strong>只针对搜索引擎显示Adsense广告</strong></p>
<p>这个技巧依旧来自于DiggLife。在DiggLife的这篇文章中，以及水煮鱼的《<a href="http://fairyfish.net/2009/02/24/google-adsense-3-tips/">提高Google Adsense收入的三个小技巧</a>》中均提到这样一个观点：</p>
<blockquote>
<p>长期浏览你博客的用户其实不会点击你的广告的，所以对于这部分用户显示广告是没有用的，所以最好的办法就是直接给来自搜索引擎的用户显示广告，一般来自搜索引擎的用户特别容易点击广告。所以针对搜索引擎显示Adsense广告，其目的就是为了减少无效展示，提高eCPM，也就是所谓的有效每千次展示的费用。据说eCPM高了，Adsense机器人会自动匹配高单价的广告到你的网页，所以在点击率一定的情况下，提高eCPM是是一种有效提高广告收入的办法。</p>
</blockquote>
<p>那么如何<strong>只针对搜索引擎显示Adsense广告？</strong>DiggLife给出了一个比较完美的解决方案： </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$referer</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_REFERER'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$se</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'google.com/search?'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'baidu.com/s?'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'soso.com/q?'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$adsense</span> <span style="color: #339933;">=</span> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;AD
&nbsp;
adsense代码
&nbsp;
AD</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$se</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//将se数组中的每一个值逐一赋给$source</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$referer</span><span style="color: #339933;">,</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$adsense</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>如果你想了解这段代码的更多含义，以及这样写的道理，那你就不妨移步到<a href="http://www.digglife.cn/articles/display-adsense-for-search-engine-only.html">这里</a>慢慢看。</p>
<p><strong><strong>（六）</strong>为<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/feed" title="显示Feed的所有日志" target="_blank">Feed</a></span> 内容添加版权信息</strong></p>
<p>在每篇博文后声明文章的版权，这是很常见的，但是它不会出现在feed订阅中。如果你是<a href="http://www.aftertown.cn">城市@后</a>的订阅用户，你就会发现在feed输出中也会有版权的显示。那么如何给你的<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/feed" title="显示Feed的所有日志" target="_blank">Feed</a></span>输出文章中也加入版权声明呢？ </p>
<p>很简单，只需在你的主题<em>function.php</em>文件的最后加入如下代码即可：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$notice</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;p&gt;&amp;copy;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &lt;a href=&quot;'</span> <span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;. All Rights Reserved.&lt;/p&gt;'</span><span style="color: #339933;">;</span> 
&nbsp;
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'add_notice'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> add_notice<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$content</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$notice</span><span style="color: #339933;">;</span>   
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_feed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">.</span><span style="color: #000088;">$notice</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>在你的feed的末尾会显示类似的版权信息：</p>
<p>?2009 城市@后. All Rights Reserved.</p>
<p>当然你还可以用这段代码在你的feed中添加广告代码。</p>
<p>转载自：<a title="http://www.aftertown.cn" href="http://www.aftertown.cn">http://www.aftertown.cn</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-skills-fair.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress无法编辑分类缩略名(Slug)的解决</title>
		<link>http://www.xixis.net/archives/wordpress-can-not-edit-category-abbreviated-name-slug-solution.html</link>
		<comments>http://www.xixis.net/archives/wordpress-can-not-edit-category-abbreviated-name-slug-solution.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 13:06:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Google管理员工具]]></category>
		<category><![CDATA[Slug]]></category>

		<guid isPermaLink="false">http://www.xixis.net/http:/www.xixis.net/wordpress/wordpress%e6%97%a0%e6%b3%95%e7%bc%96%e8%be%91%e5%88%86%e7%b1%bb%e7%bc%a9%e7%95%a5%e5%90%8dslug%e7%9a%84%e8%a7%a3%e5%86%b3/ </guid>
		<description><![CDATA[今天在获得Google管理员工具的抓取错误信息之后想整理一下分类和标签,发现当修改分类缩略名(Slug)的时候Wordpress始终提示&#34;分类未更新&#34;,亦然保持原有的缩略名.用Google搜索了一圈之后没有找到相关文章,只好用英文搜索相关内容,最终发现了原因所在和解决方案. 
 

造成无法更改分类缩略名的原因很简单,Wordpress 2.3及以上的版本由于引进了标签功能,Wordpress数据库结构发生了变化,链接分类,日志分类和标签被整合到wp_terms表中(这个页面有详细说明).由于分类缩略名必须唯一,所以如果你已经使用了某个词作为标签或者链接分类,那么你将无法将其作为分类缩略名. 
知道原因之后解决起来就非常简单了,无非是使用另外一个分类缩略名或者删除那个重复的标签.这就要看哪个损失比较小了,如果你的日志里已经多次连接到这个分类,那么最好使用Simple Tags删除或者修改标签,反之则修改分类缩略名. 
所以说,如果你的博客才建立不久,最好确定所有应该固定下来的链接,比如页面缩略名,分类缩略名,日志永久链接结构等,不然修改起来会非常麻烦,而且会造成不必要的损失. 
顺便求助一下:Google网站管理员工具提示了接近100个无法找到的网址,我发现很多是添加链接的时候失误,或者链接后来变化造成,但是单单根据Google网站管理员提供的一个链接很难定位到问题所在的网址,
]]></description>
			<content:encoded><![CDATA[<p>今天在获得Google管理员工具的抓取错误信息之后想整理一下分类和标签,发现当修改分类缩略名(<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/slug" title="显示Slug的所有日志" target="_blank">Slug</a></span>)的时候Wordpress始终提示&quot;分类未更新&quot;,亦然保持原有的缩略名.用Google搜索了一圈之后没有找到相关文章,只好用英文搜索相关内容,最终发现了原因所在和解决方案. </p>
<p> <span id="more-314"></span>
</p>
<p>造成无法更改分类缩略名的原因很简单,Wordpress 2.3及以上的版本由于引进了标签功能,Wordpress数据库结构发生了变化,链接分类,日志分类和标签被整合到wp_terms表中(<a href="http://codex.wordpress.org/Database_Description/2.3" target="_blank">这个页面</a>有详细说明).由于分类缩略名必须唯一,所以如果你已经使用了某个词作为标签或者链接分类,那么你将无法将其作为分类缩略名. </p>
<p>知道原因之后解决起来就非常简单了,无非是使用另外一个分类缩略名或者删除那个重复的标签.这就要看哪个损失比较小了,如果你的日志里已经多次连接到这个分类,那么最好使用Simple Tags删除或者修改标签,反之则修改分类缩略名. </p>
<p>所以说,如果你的博客才建立不久,最好确定所有应该固定下来的链接,比如页面缩略名,分类缩略名,日志永久链接结构等,不然修改起来会非常麻烦,而且会造成不必要的损失. </p>
<p>顺便求助一下:Google网站管理员工具提示了接近100个无法找到的网址,我发现很多是添加链接的时候失误,或者链接后来变化造成,但是单单根据Google网站管理员提供的一个链接很难定位到问题所在的网址,</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-can-not-edit-category-abbreviated-name-slug-solution.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>玩转WordPress配置文件 (分享一下使用wp-config.php的技巧)</title>
		<link>http://www.xixis.net/archives/fun-wordpress-configuration-file-wp-config-php-to-share-the-use-of-the-skills.html</link>
		<comments>http://www.xixis.net/archives/fun-wordpress-configuration-file-wp-config-php-to-share-the-use-of-the-skills.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 10:42:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-config.php]]></category>
		<category><![CDATA[网站优化]]></category>
		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.xixis.net/?p=312</guid>
		<description><![CDATA[WordPress用户都知道，wp-config.php 文件是WordPress数据库的关键。数据库名、用户名、密码、位置都是在此设置。
但是很多用户并不知道通过wp-config.php文件可以更改很多设置，提高WordPress站点的功能、性能、安全度。在这里，这里跟大家分享下使用wp-config.php的技巧。
 

数据库信息
WordPress链接数据库需设定以下四个值:
define(&#8216;DB_NAME&#8217;, &#8216;database-name&#8217;);      define(&#8216;DB_USER&#8217;, &#8216;database-username&#8217;);       define(&#8216;DB_PASSWORD&#8217;, &#8216;database-password&#8217;);       define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);

在创建数据库前就需准备好数据库名称、用户名、密码，最后一个DB_HOST值可能比较难获得，最常见的是直接用“localhost”， 甚至你可以给数据库服务器指定一个备用端口。例如：
define(&#8216;DB_HOST&#8217;, &#8216;localhost:1234&#8242;);
define(&#8216;DB_HOST&#8217;, &#8216;mysql.domain.tld:1234&#8242;);

还有一种更好的方法就是自动检测数据库服务器值：
define(&#8216;DB_HOST&#8217;, $_ENV{DATABASE_SERVER});

如果上面所有方法都行不通，求助你的服务器提供商。
数据库字符集和整理(collation)
截至WordPress 2.2版，你可以给MySQL数据库指定字符集。一般来说，不需要修改默认字符集UTF-8，因为它支持所有的语言。注意，如果wp- config.php文件里，这一字符集已经存在，你只能使用此字符集。下面是默认的设置，也是我推荐大家使用的设置：
define(&#8216;DB_CHARSET&#8217;, &#8216;utf8&#8242;);

WordPress 2.2 版本还可以指定collation（校勘/整理），对你的数据库字符集排序。Collation的设置通常由MySQL依据字符集自动处理的，在默认设置里的collation值保留空白就可以。默认的设置：
define(&#8216;DB_COLLATE&#8217;, &#8221;);

安全密匙
截至WordPress 2.7后有四个安全密匙来加密cookies。这些密匙只需让它默默无闻地工作就好，并尽可能随意和复杂（你无需记住）。生成这些密匙的最简单方法就是通过WordPress官方密匙服务来自动生成。只要点击这个服务，复制并粘贴生成的结果到wp-config.php 文件中即可。注意，这些密匙可随时更改，这样一来，用户之前的cookies会被清除需要重新登陆你的网站。
define(&#8216;AUTH_KEY&#8217;, &#8216;:dr+%/5V4sAUG-gg%aS*v;&#38;xGhd%{YV)p:Qi?jXLq,&#60;h\\`39&#8242;);      define(&#8216;SECURE_AUTH_KEY&#8217;, &#8216;@*+S=8\&#34;\&#8217;+\&#34;}]&#60;m#+}V)p:Qi?jXLq,&#60;h\\`39m_(&#8216;);       define(&#8216;LOGGED_IN_KEY&#8217;, &#8216;S~AACm4h1;T^\&#34;qW3_8Zv!Ji=y&#124;)~5i63JI &#124;Al[(&#60;YS');       define('NONCE_KEY', 'k1+EOc-&#38;w?hG8j84&#62;6L9v\&#34;6C89NH?ui{*3\\(t09mumL/fF');

数据库前缀
数据库前缀的设置对提高你的站点安全以及在同一数据库中安装多个WordPress站点都非常有用，通过改变默认值“wp_” 为随机独一的值，可减轻站点受攻击的可能性，总体上提高你的网站安全性。下面是默认值：
$table_prefix = 'wp_';

有很多攻击者就是对准这些默认前缀的数据库进行攻击。稍微修改为如： “x777_”之类的可避免此类攻击。
你还可以使用此设置实现在一个数据库中安装多个WordPress站点，只要给每一个WordPress指定一个单独的数据库前缀即可：
$table_prefix = 'wp1_'; // 第一个博客      $table_prefix = 'wp2_'; // 第二个博客       $table_prefix = ...]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>用户都知道，<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wp-config-php" title="显示wp-config.php的所有日志" target="_blank">wp-config.php</a></span> 文件是<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>数据库的关键。数据库名、用户名、密码、位置都是在此设置。</p>
<p>但是很多用户并不知道通过<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wp-config-php" title="显示wp-config.php的所有日志" target="_blank">wp-config.php</a></span>文件可以更改很多设置，提高<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span>站点的功能、性能、安全度。在这里，这里跟大家分享下使用wp-config.php的技巧。</p>
<p> <span id="more-312"></span>
</p>
<h5>数据库信息</h5>
<p>WordPress链接数据库需设定以下四个值:</p>
<blockquote><p>define(&#8216;DB_NAME&#8217;, &#8216;database-name&#8217;);      <br />define(&#8216;DB_USER&#8217;, &#8216;database-username&#8217;);       <br />define(&#8216;DB_PASSWORD&#8217;, &#8216;database-password&#8217;);       <br />define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);</p>
</blockquote>
<p>在创建数据库前就需准备好数据库名称、用户名、密码，最后一个DB_HOST值可能比较难获得，最常见的是直接用“localhost”， 甚至你可以给数据库服务器指定一个备用端口。例如：</p>
<blockquote><p>define(&#8216;DB_HOST&#8217;, &#8216;localhost:1234&#8242;);</p>
<p>define(&#8216;DB_HOST&#8217;, &#8216;mysql.domain.tld:1234&#8242;);</p>
</blockquote>
<p>还有一种更好的方法就是自动检测数据库服务器值：</p>
<blockquote><p>define(&#8216;DB_HOST&#8217;, $_ENV{DATABASE_SERVER});</p>
</blockquote>
<p>如果上面所有方法都行不通，求助你的服务器提供商。</p>
<h5>数据库字符集和整理(collation)</h5>
<p>截至WordPress 2.2版，你可以给MySQL数据库指定字符集。一般来说，不需要修改默认字符集UTF-8，因为它支持所有的语言。注意，如果wp- config.php文件里，这一字符集已经存在，你只能使用此字符集。下面是默认的设置，也是我推荐大家使用的设置：</p>
<blockquote><p>define(&#8216;DB_CHARSET&#8217;, &#8216;utf8&#8242;);</p>
</blockquote>
<p>WordPress 2.2 版本还可以指定collation（校勘/整理），对你的数据库字符集排序。Collation的设置通常由MySQL依据字符集自动处理的，在默认设置里的collation值保留空白就可以。默认的设置：</p>
<blockquote><p>define(&#8216;DB_COLLATE&#8217;, &#8221;);</p>
</blockquote>
<h5>安全密匙</h5>
<p>截至WordPress 2.7后有四个安全密匙来加密cookies。这些密匙只需让它默默无闻地工作就好，并尽可能随意和复杂（你无需记住）。生成这些密匙的最简单方法就是通过WordPress官方密匙服务来自动生成。只要点击这个服务，复制并粘贴生成的结果到wp-config.php 文件中即可。注意，这些密匙可随时更改，这样一来，用户之前的cookies会被清除需要重新登陆你的网站。</p>
<blockquote><p>define(&#8216;AUTH_KEY&#8217;, &#8216;:dr+%/5V4sAUG-gg%aS*v;&amp;xGhd%{YV)p:Qi?jXLq,&lt;h\\`39&#8242;);      <br />define(&#8216;SECURE_AUTH_KEY&#8217;, &#8216;@*+S=8\&quot;\&#8217;+\&quot;}]&lt;m#+}V)p:Qi?jXLq,&lt;h\\`39m_(&#8216;);       <br />define(&#8216;LOGGED_IN_KEY&#8217;, &#8216;S~AACm4h1;T^\&quot;qW3_8Zv!Ji=y|)~5i63JI |Al[(&lt;YS');       <br />define('NONCE_KEY', 'k1+EOc-&amp;w?hG8j84&gt;6L9v\&quot;6C89NH?ui{*3\\(t09mumL/fF');</p>
</blockquote>
<h5>数据库前缀</h5>
<p>数据库前缀的设置对提高你的站点安全以及在同一数据库中安装多个WordPress站点都非常有用，通过改变默认值“wp_” 为随机独一的值，可减轻站点受攻击的可能性，总体上提高你的网站安全性。下面是默认值：</p>
<blockquote><p>$table_prefix = 'wp_';</p>
</blockquote>
<p>有很多攻击者就是对准这些默认前缀的数据库进行攻击。稍微修改为如： “x777_”之类的可避免此类攻击。</p>
<p>你还可以使用此设置实现在一个数据库中安装多个WordPress站点，只要给每一个WordPress指定一个单独的数据库前缀即可：</p>
<blockquote><p>$table_prefix = 'wp1_'; // 第一个博客      <br />$table_prefix = 'wp2_'; // 第二个博客       <br />$table_prefix = 'wp3_'; // 第三个博客</p>
</blockquote>
<h5>语言设置</h5>
<p>WordPress可指定一个语言翻译文件及其相关的目录。语言翻译文件属于 “.mo” 这一类别，其默认位置是 (如果没有明确指定的路径) wp-content/languages (第一)和wp-includes/languages (第二)。下面是默认设置：</p>
<blockquote><p>define('WPLANG', '');      <br />define('LANGDIR', '');</p>
</blockquote>
<h5>目录设置</h5>
<p>技术上来说，你不太需要关注它。默认的wp-config.php 文件里有几行指定绝对路径并且包含设置文件。我这里提出来，只是为了使这篇文章更完整些：</p>
<blockquote><p>/** WordPress absolute path to the Wordpress directory. */      <br />if ( !defined('ABSPATH') )       <br />define('ABSPATH', dirname(__FILE__) . '/');</p>
<p>/** Sets up WordPress vars and included files. */      <br />require_once(ABSPATH . 'wp-settings.php');</p>
</blockquote>
<h5>博客地址和网站地址</h5>
<p>默认的p-config.php中不包含这两个定义，不过为了改善WordPress的性能，还是需要添加的。这两个设置是在2.2版本引进来的。在wp-config.php 中添加者两个定义可降低数据库查询数，提高网站的运行。这些设置需与你的WordPress Admin中的设置一致。下面是一个例子 (所有URL地址不以斜线结尾):</p>
<blockquote><p>define('WP_HOME', 'http://digwp.com');      <br />define('WP_SITEURL', 'http://digwp.com');</p>
</blockquote>
<p>可以使用全局变量动态地设置这些值：</p>
<blockquote><p>define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST'].&#8217;/path/to/wordpress&#8217;);      <br />define(&#8216;WP_SITEURL&#8217;, &#8216;http://&#8217;.$_SERVER['HTTP_HOST'].&#8217;/path/to/wordpress&#8217;);</p>
</blockquote>
<h5>模板路径和样式表路径</h5>
<p>设定好博客地址和网站地址后，你还可以通过剔除对模板路径和样式表路径的数据库查询，这样可提高站点的性能。下面是默认的值:</p>
<blockquote><p>define(&#8216;TEMPLATEPATH&#8217;, get_template_directory());      <br />define(&#8216;STYLESHEETPATH&#8217;, get_stylesheet_directory());</p>
</blockquote>
<p>尽管数据库查询还存在，但我们可以减少多余的查询:</p>
<blockquote><p>define(&#8216;TEMPLATEPATH&#8217;, &#8216;/absolute/path/to/wp-content/themes/active-theme&#8217;);      <br />define(&#8216;STYLESHEETPATH&#8217;, &#8216;/absolute/path/to/wp-content/themes/active-theme&#8217;);</p>
</blockquote>
<h5>禁用缓存和缓存有效期</h5>
<p>这两个都是针对旧版本的WordPress，还在使用默认的基于对象的缓存机制。第一个选项是启用或禁用缓存。第二个定义让你指定缓存的到期时间。    <br />启用缓存</p>
<blockquote><p>define(&#8216;WP_CACHE&#8217;, true); // 启用缓存      <br />define(&#8216;ENABLE_CACHE&#8217;, true); // 启用缓存       <br />define(&#8216;CACHE_EXPIRATION_TIME&#8217;, 3600); // 单位秒</p>
</blockquote>
<p>禁用缓存</p>
<blockquote><p>define(&#8216;WP_CACHE&#8217;, false); //禁用缓存      <br />define(&#8216;DISABLE_CACHE&#8217;, true); // 禁用缓存</p>
</blockquote>
<h5>指定cookies域</h5>
<p>会由于很多原因你需要给站点指定cookies域。比较常见的就是阻止子域名上请求静态内容的cookies不必要的传输。这种情况下，你就可以使用此定义告知WordPress只向非静态域发送cookies，这将会大大提高网站的性能。下面是设置各种cookies路径和域的信息：</p>
<blockquote><p>define(&#8216;COOKIE_DOMAIN&#8217;, &#8216;.digwp.com&#8217;); // 别漏了前面的&#8217;.'。      <br />define(&#8216;COOKIEPATH&#8217;, preg_replace(&#8216;|https?://[^/]+|i&#8217;, &#8221;, get_option(&#8216;home&#8217;).&#8217;/'));       <br />define(&#8216;SITECOOKIEPATH&#8217;, preg_replace(&#8216;|https?://[^/]+|i&#8217;, &#8221;, get_option(&#8217;siteurl&#8217;).&#8217;/'));       <br />define(&#8216;PLUGINS_COOKIE_PATH&#8217;, preg_replace(&#8216;|https?://[^/]+|i&#8217;, &#8221;, WP_PLUGIN_URL));       <br />define(&#8216;ADMIN_COOKIE_PATH&#8217;, SITECOOKIEPATH.&#8217;wp-admin&#8217;);</p>
</blockquote>
<h5>覆盖文件权限</h5>
<p>如果你的虚拟主机默认文件权限非常严格，在WordPress<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e9%85%8d%e7%bd%ae" title="显示配置的所有日志" target="_blank">配置</a></span>文件里添加这些定义就可以解决这个问题。注意，数值不需要用引号引起来。下面是例子：</p>
<blockquote><p>define(&#8216;FS_CHMOD_FILE&#8217;, 0755);      <br />define(&#8216;FS_CHMOD_DIR&#8217;, 0755);</p>
</blockquote>
<h5>查看所有已定义的常量</h5>
<p>需要查看所有已定义的常量吗？用下面的PHP函数就会得到一个所有当前一定义常数的数组：</p>
<blockquote><p>print_r(@get_defined_constants());</p>
</blockquote>
<h5>自定义用户和usermeta 表</h5>
<p>你也可以通过下面的定义自定义用户和usermeta表：</p>
<blockquote><p>define(&#8216;CUSTOM_USER_TABLE&#8217;, $table_prefix.&#8217;my_users&#8217;);      <br />define(&#8216;CUSTOM_USER_META_TABLE&#8217;, $table_prefix.&#8217;my_usermeta&#8217;);</p>
</blockquote>
<h5>FTP/SSH常量</h5>
<p>这类定义是用于帮助用户定位和实现FTP/SSH连接。下面是例子:</p>
<blockquote><p>define(&#8216;FS_METHOD&#8217;, &#8216;ftpext&#8217;); // 文件系统的方式，包括： &quot;direct&quot;、&quot;ssh&quot;、&quot;ftpext&quot;和&quot;ftpsockets&quot;      <br />define(&#8216;FTP_BASE&#8217;, &#8216;/path/to/wordpress/&#8217;); // 安装根目录的绝对路径       <br />define(&#8216;FTP_CONTENT_DIR&#8217;, &#8216;/path/to/wordpress/wp-content/&#8217;); // 到&quot;wp-content&quot; 目录的绝对路径       <br />define(&#8216;FTP_PLUGIN_DIR &#8216;, &#8216;/path/to/wordpress/wp-content/plugins/&#8217;); // 到&quot;wp-plugins&quot; 目录的绝对路径       <br />define(&#8216;FTP_PUBKEY&#8217;, &#8216;/home/username/.ssh/id_rsa.pub&#8217;); // 到SSH公匙的绝对路径       <br />define(&#8216;FTP_PRIVKEY&#8217;, &#8216;/home/username/.ssh/id_rsa&#8217;); //到SSH密匙的绝对路径       <br />define(&#8216;FTP_USER&#8217;, &#8216;username&#8217;); // FTP 或SSH用户名       <br />define(&#8216;FTP_PASS&#8217;, &#8216;password&#8217;); // FTP用户密码       <br />define(&#8216;FTP_HOST&#8217;, &#8216;ftp.domain.tld:21&#8242;); //主机名:你的SSH/FTP服务器端口</p>
</blockquote>
<h5>移动wp-content 目录</h5>
<p>从2.6版本开始，你可以修改wp-content目录的位置。这么做有几个理由，包括可提高网站的安全性，以及便于FTP更新。下面是例子：</p>
<blockquote><p>// 当前目录的完全本地路径(结尾不包括斜杠)      <br />define(&#8216;WP_CONTENT_DIR&#8217;, $_SERVER['DOCUMENT_ROOT'].&#8217;/path/wp-content&#8217;);</p>
<p>// 当前目录的完整URL(结尾不包括斜杠)      <br />define(&#8216;WP_CONTENT_URL&#8217;, &#8216;http://domain.tld/path/wp-content&#8217;);</p>
</blockquote>
<p>你也可以另外给wp-content 目录指定一个自定义路径。可以解决一些插件的兼容性问题：</p>
<blockquote><p>//当前目录的完全本地路径(结尾不包括斜杠)      <br />define(&#8216;WP_PLUGIN_DIR&#8217;, $_SERVER['DOCUMENT_ROOT'].&#8217;/path/wp-content/plugins&#8217;);</p>
<p>//当前目录的完整URL(结尾不包括斜杠)      <br />define(&#8216;WP_PLUGIN_URL&#8217;, &#8216;http://domain.tld/path/wp-content/plugins&#8217;);</p>
</blockquote>
<h5>日志修订版的处理</h5>
<p>Worepress最新版本提供了一个发布后修改系统，用户可保存不同的博客版本，甚至，如果有需要的话，还可以恢复到先前保存的博客版本。不管你喜欢还是不喜欢这个功能，下面的设置可能都对你有帮助。</p>
<p>限制保存博客版本的数量</p>
<blockquote><p>define(&#8216;WP_POST_REVISIONS&#8217;, 3); // 任意整数，不过不要太夸张。</p>
</blockquote>
<p>禁用修订版功能</p>
<blockquote><p>define(&#8216;WP_POST_REVISIONS&#8217;, false);</p>
</blockquote>
<h5>指定自动保存间隔</h5>
<p>跟发布版本功能类似，WordPress其实使用了自动保存功能。默认情况下，WordPress每一分钟自动保存你的作品，不过你完全可以根据需要改变这个数值。不过也注意不要太夸张，以免破坏了你的服务器。</p>
<blockquote><p>define(&#8216;AUTOSAVE_INTERVAL&#8217;, 160); // 单位秒</p>
</blockquote>
<h5>调试WordPress</h5>
<p>自从2.3.1版本以来，有一些错误和警告提示帮助用户调试网站。截止2.5版本， 报错等级提高到E_ALL并有激活对一些函数的警告功能。默认(即，没有在wp-config.php文件中指定任何定义)，错误报告被禁用。</p>
<blockquote><p>define(&#8216;WP_DEBUG&#8217;, true); // 启用调试模式      <br />define(&#8216;WP_DEBUG&#8217;, false); // 禁用调试模式（默认）</p>
</blockquote>
<h5>错误日志<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e9%85%8d%e7%bd%ae" title="显示配置的所有日志" target="_blank">配置</a></span></h5>
<p>下面是启用WordPress站点错误日志的一种简单方法。创建一个名为“php_error.log”的文件，使其对服务器可写，并将其放置在你选择的目录下。接着在下面代码中第三行编辑路径，并加入wp-config.php 中：</p>
<blockquote><p>@ini_set(&#8216;log_errors&#8217;,'On&#8217;);      <br />@ini_set(&#8216;display_errors&#8217;,'Off&#8217;);       <br />@ini_set(&#8216;error_log&#8217;,'/home/path/domain/logs/php_error.log&#8217;);</p>
</blockquote>
<h5>增加PHP内存</h5>
<p>如果你收到错误提示“允许的内存xxx字节已用尽” ，这个设置就对你有帮助了。截至WordPress的2.5版，WP_MEMORY_LIMIT定义，你可以指定PHP使用的最大内存。默认情况下，最大 PHP内存是32兆，因此只有要求大于32兆是菜需要更改此设置。注意，有些虚拟主机禁止你提高PHP 内存，所以你得请求他们帮忙。下面是例子：</p>
<blockquote><p>define(&#8216;WP_MEMORY_LIMIT&#8217;, &#8216;64M&#8217;);      <br />define(&#8216;WP_MEMORY_LIMIT&#8217;, &#8216;96M&#8217;);       <br />define(&#8216;WP_MEMORY_LIMIT&#8217;, &#8216;128M&#8217;);</p>
</blockquote>
<h5>保存并显示数据库查询以供分析</h5>
<p>这个技术可实现保存并显示数据库查询的信息以备后面分析。这个过程保存了每一次查询、相关的函数以及总的执行时间。这些信息都保存为一个数组的形式，并可显示在任何模板页上。不过，首先得在你的wp-config.php 文件添加下面的指令：</p>
<blockquote><p>define(&#8216;SAVEQUERIES&#8217;, true);</p>
</blockquote>
<p>然后，在主题的footer上加上下面的代码：</p>
<blockquote><p>// 只对admin显示查询数组      <br />if (current_user_can(&#8216;level_10&#8242;)) {       <br />global $wpdb;       <br />echo &quot;&lt;pre&gt;&quot;;       <br />print_r($wpdb-&gt;queries);       <br />echo &quot;&lt;/pre&gt;&quot;;       <br />}</p>
</blockquote>
<p>下面是此函数的单行版本:</p>
<blockquote><p>&lt;?php if (current_user_can(&#8216;level_10&#8242;)) { global $wpdb; echo &quot;&lt;pre&gt;&quot;; print_r($wpdb-&gt;queries); echo &quot;&lt;/pre&gt;&quot;; } ?&gt;</p>
</blockquote>
<h5>限制代理访问</h5>
<p>WordPress 2.8及以上版本，可用配置文件定义一些常量，包括封锁、允许、过滤从一个代理服务器访问特定主机。例如，如果你的WordPress站点是联网的，你需要阻止访问任何外部主机，只允许本地主机访问，使用下面第一个定义。如果你允许特定主机访问，用逗号分隔主机名称即可，像下面第三个定义一样。注意，请允许api.wordpress.org访问，确保一些核心文件和插件能起到恰当的作用。</p>
<blockquote><p>define(&#8216;WP_HTTP_BLOCK_EXTERNAL&#8217;, true); // 阻止外部请求      <br />define(&#8216;WP_HTTP_BLOCK_EXTERNAL&#8217;, false); // 允许外部请求       <br />define(&#8216;WP_ACCESSIBLE_HOSTS&#8217;, &#8216;api.wordpress.org&#8217;); // 白名单主机</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/fun-wordpress-configuration-file-wp-config-php-to-share-the-use-of-the-skills.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress 提速之 Gzip 压缩</title>
		<link>http://www.xixis.net/archives/wordpress-speed-of-gzip-compression.html</link>
		<comments>http://www.xixis.net/archives/wordpress-speed-of-gzip-compression.html#comments</comments>
		<pubDate>Sun, 07 Feb 2010 14:29:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.xixis.net/?p=304</guid>
		<description><![CDATA[今天来聊下 wordpress 提速，其实关于这方面的话题网上其实蛮多的，速度对一个网站来说无疑是非常重要的，对于速度的追求也是无止境的，在这方面的表率无疑就是 shawn 了，看他博客的很多技巧都是针对速度来的……不过话说回来，速度也不是绝对的，看很多优秀的博客速度并不占优，有时候追求速度难免还会牺牲一些其它的东西！！此文仅供参考。
废话少说，关于 wordpress 的提速还是可以从很多方面入手的，因为 WP 的灵活而导致其效率和速度的下降，比如因为使用插件而在头部载入的 N 多的 JS 和 CSS 就是最为典型的，就不展开说了，今天我们只说 Gzip！
什么是 Gzip 压缩，为什么要用 Gzip 压缩
说白了就是一种压缩的技术，它将浏览器请求的文件在服务器端进行压缩，然后将文件以压缩的形式传递给浏览器，然后在浏览器端进行解压缩，还原后进行解析。而目前 99% 的浏览器都支持 Gzip ，包括 IE 4+, Netscape 4+, Opera 5+ 和所有版本的 Safari 和 Firefox ，所以大家可以放心使用。
在这里我们的压缩对象是所有的 html、JS、和 CSS 。而他的压缩效率惊人，能减小 60% 到70%。像我的博客一个 10K 的 JS 文件，用 Gzip 压缩后浏览器接收的只有 3K 大小，16K 的 CSS 文件也被压缩到了 5K，很强大吧！
怎么知道我的页面是否 Gzip 压缩过了
Gzip 的方法有很多种，而有很多的服务器是默认开启 Gzip 压缩的，不过据我所知，这种服务器少之又少。怎么确定自己的网页是否被 Gzip 呢！！这种测试的网站网上也很多，不过一般只能测试 html，这里推荐给大家一个测试的网站：Websiteoptimization，输入网址后，输入验证码，就会给出你的 Web Page Speed Report.
貌似很多的“童鞋”看错了，现在补图上来！！其中在下面的 Page Objects 中，会给出所有所加载的文件的信息。在最后一栏的信息中，如果显示：Congratulations! This file was compressed. 说明是被压缩过的，如果是：Up to **** bytes could have been saved through compression，显然是还没被压缩的。
启用 Gzip 的几种方法
是的，有几种方法，是针对不同的情况的。
1、最好的情况是你的主机采用的是 Apache 2，并安装启用了mod_deflate 模块。这样就很简单了，只需要在 .htaccess 文件中加入以下代码可以压缩 HTML, PHP, ...]]></description>
			<content:encoded><![CDATA[<p>今天来聊下 wordpress 提速，其实关于这方面的话题网上其实蛮多的，速度对一个网站来说无疑是非常重要的，对于速度的追求也是无止境的，在这方面的表率无疑就是 <a href="http://ishawn.net/">shawn</a> 了，看他博客的很多技巧都是针对速度来的……不过话说回来，速度也不是绝对的，看很多优秀的博客速度并不占优，有时候追求速度难免还会牺牲一些其它的东西！！此文仅供参考。<span id="more-304"></span></p>
<p>废话少说，关于 wordpress 的提速还是可以从很多方面入手的，因为 WP 的灵活而导致其效率和速度的下降，比如因为使用插件而在头部载入的 N 多的 JS 和 CSS 就是最为典型的，就不展开说了，今天我们只说 Gzip！</p>
<h3>什么是 Gzip 压缩，为什么要用 Gzip 压缩</h3>
<p>说白了就是一种压缩的技术，它将浏览器请求的文件在服务器端进行压缩，然后将文件以压缩的形式传递给浏览器，然后在浏览器端进行解压缩，还原后进行解析。而目前 99% 的浏览器都支持 Gzip ，包括 IE 4+, Netscape 4+, Opera 5+ 和所有版本的 Safari 和 Firefox ，所以大家可以放心使用。</p>
<p><strong>在这里我们的压缩对象是所有的 html、JS、和 CSS 。而他的压缩效率惊人，能减小 60% 到70%。像我的博客一个 10K 的 JS 文件，用 Gzip 压缩后浏览器接收的只有 3K 大小，16K 的 CSS 文件也被压缩到了 5K，很强大吧！</strong></p>
<h3>怎么知道我的页面是否 Gzip 压缩过了</h3>
<p>Gzip 的方法有很多种，而有很多的服务器是默认开启 Gzip 压缩的，不过据我所知，这种服务器少之又少。怎么确定自己的网页是否被 Gzip 呢！！这种测试的网站网上也很多，不过一般只能测试 html，这里推荐给大家一个测试的网站：<a href="http://www.websiteoptimization.com/services/analyze/">Websiteoptimization</a>，输入网址后，输入验证码，就会给出你的 Web Page Speed Report.</p>
<p>貌似很多的“童鞋”看错了，现在补图上来！！其中在下面的 Page Objects 中，会给出所有所加载的文件的信息。在最后一栏的信息中，<strong>如果显示：Congratulations! This file was compressed. 说明是被压缩过的，如果是：Up to **** bytes could have been saved through compression，显然是还没被压缩的。</strong></p>
<h3>启用 Gzip 的几种方法</h3>
<p>是的，有几种方法，是针对不同的情况的。</p>
<p>1、最好的情况是你的主机采用的是 Apache 2，并安装启用了mod_deflate 模块。这样就很简单了，只需要在 .<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/htaccess" title="显示htaccess的所有日志" target="_blank">htaccess</a></span> 文件中加入以下代码可以压缩 HTML, PHP, JS, CSS, XML 后缀的文件。</p>
<blockquote><p>&lt;ifmodule mod_deflate.c&gt;</p>
<p>AddOutputFilterByType DEFLATE text/html text/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/css" title="显示css的所有日志" target="_blank">css</a></span> text/plain text/xml application/x-httpd-php application/x-<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/javascript" title="显示javascript的所有日志" target="_blank">javascript</a></span></p>
<p>&lt;/ifmodule&gt;</p></blockquote>
<p>不过一般的主机都没有这个模块，如果你是独立主机可以自行配置。至于如何检测自己的主机是否有安装这个模块，我还真没找到办法，望高手指点。如果大家有兴趣，可能将上面的代码加好，看是否 Gzip 来试一下！以上方法来自：<a href="http://fairyfish.net/2008/04/07/gzip/">我爱水煮鱼</a></p>
<p>2、用 PHP 来压缩</p>
<p>此方法也需要 PHP 模块 zlib 的支持，不过这是一个基本的模块，一般都开启了！！所以我们主要讲下这部分。</p>
<h3>用 PHP 压缩动态页面</h3>
<p>我们先来看所谓的 html 的压缩，其实也就是由 PHP 动态生成的 html 。这样的方法有很多，我用的是 <a href="http://ishawn.net/tips/enable-gzip-function-of-hostgator.html">shawn 的方法</a> ，还有 <a href="http://wmrpd.com/blog/?p=300">几种方法</a> 供参考。</p>
<h3>用 PHP 压缩 JS 和CSS</h3>
<p><strong>关于 JS 和 CSS 的压缩也有几种方法，目前比较多的是像 K2 学习，将 JS 和 CSS 改为 .php 的方法</strong>。这个前辈已经介绍过了，请移步：<a href="http://sexywp.com/simple-guide-to-css-js-compress.htm">简述对WP博客样式表和JS脚本的压缩</a></p>
<p>这种方法的缺点是要修改每个 JS 和 CSS 文件，有点不太方便。对于将所有插件中的 JS 和CSS 都合并的博客来说还算容易，但没有合并的来说无疑是一项巨大的工程，而且插件更新也是件麻烦的事。另外看着好好的 CSS 文件变成了 PHP ，看着挺怪的，呵呵！！好处是有好的适应性，因为这 K2 用的方法！</p>
<p><strong>第二种方法是老N提供的方法</strong>：<a href="http://neolee.cn/wordpress/compress-js-css/">加速blog，压缩js,css，减省带宽</a> ，这种方法应该说比较简单，而且默认对所有的 JS 和 CSS 生效。原理就是把 JS 和 CSS 利用 .<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/htaccess" title="显示htaccess的所有日志" target="_blank">htaccess</a></span> 交给一个 PHP 文件来处理进行压缩。</p>
<p>老N那的代码貌似复制出来有些问题，我再贴一下，呵呵：</p>
<blockquote><p>1、创建 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/gzip" title="显示gzip的所有日志" target="_blank">gzip</a></span>.php 文件并上传到博客根目录，代码如下：</p>
<p>下载: <a href="http://www.xiaorsz.com/wp-content/plugins/coolcode/coolcode.php?p=632&amp;download=gzip.php">gzip.php</a></p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>p  <span style="color: #000088;">$allowed</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>  <span style="color: #0000ff;">'<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/css" title="显示css的所有日志" target="_blank">css</a></span>'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'text/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/css" title="显示css的所有日志" target="_blank">css</a></span>'</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">'js'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'text/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/javascript" title="显示javascript的所有日志" target="_blank">javascript</a></span>'</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">'html'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'text/html'</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">'htm'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'text/html'</span><span style="color: #339933;">,</span>  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>  <span style="color: #000088;">$extension</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #000088;">$extension</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$extension</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$allowed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$extension</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>  <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'..'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pos</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #990000;">is_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>  <span style="color: #339933;">@</span><span style="color: #990000;">ob_start</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ob_gzhandler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>Content<span style="color: #339933;">-</span>type<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$allowed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$extension</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> charset<span style="color: #339933;">:</span> UTF<span style="color: #339933;">-</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>  <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HTTP/1.1 404 Not Found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #009900;">&#125;</span>  <span style="color: #009900;">&#125;</span> <span style="color: #339933;">--&gt;</span></pre></div></div>

<blockquote><p>2、更改.htaccess文件，在.htaccess中添加：</p>
<p>RewriteCond %{REQUEST_FILENAME} -f</p>
<p>RewriteCond %{REQUEST_FILENAME} ^.*\.(css|js|html|htm)$</p>
<p>RewriteRule ^(.*)$ <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/gzip" title="显示gzip的所有日志" target="_blank">gzip</a></span>.php?url=$1 [QSA,L]</p>
<p>就 OK 了~，的确很简单</p></blockquote>
<p>但上面两种方法还有一个问题，就是会吃服务器的资源，占用一定的 CPU 和内存，因为每次访问页面都要执行一下。但具体吃到什么程度，我就不清楚了，据说在服务器资源紧张的情况下压缩的效率会比较低，不过我想一般大型的主机提供商的主机还是不会有什么问题的。</p>
<p>第三种我们来看 <a href="http://www.thirdinfo.com/how-to-better-wp.htm">辐射鱼提供的方法</a></p>
<blockquote><p>1. 下载 <a href="http://wopus.googlecode.com/files/gzip.php">Gzip.php</a> 文件并上传到你的Wordpress安装目录</p>
<p>2. 在你的 Wordpress 根目录建立 wp-cache 文件夹并确保其可写入</p>
<p>3. 在.htaccess里面加上</p>
<p>RewriteRule (.*.css$|.*.js$) gzip.php?$1 [L]</p>
<p>即可</p></blockquote>
<p>也非常的简单，而且此种方法的优点是：自动读取并 gzip 压缩 css 和 js，访问时直接调用生成的 .gz 文件，节约带宽也不占用服务器资源，<strong>但不适用空间下安装了多个 Wordpress 的博友</strong>，可能导致二级目录下的某些 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 无法加载 CSS 样式。这些都是辐射鱼的原话，呵呵！另外就是当 CSS 和 JS 有更新时要手动清除缓存才行。符合条件的同志推荐用这种方法！！</p>
<p>转载自：<a title="http://www.xiaorsz.com/wordpress-gzip-compression-improve-the-speed/" href="http://www.xiaorsz.com/wordpress-gzip-compression-improve-the-speed/">http://www.xiaorsz.com/wordpress-gzip-compression-improve-the-speed/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-speed-of-gzip-compression.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zlib压缩WordPress</title>
		<link>http://www.xixis.net/archives/zlib-compression-wordpress.html</link>
		<comments>http://www.xixis.net/archives/zlib-compression-wordpress.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 19:32:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.xixis.net/?p=264</guid>
		<description><![CDATA[WordPress 默认状态下是不提供压缩代码输出到用户浏览器的，但只要简单的几行代码就可以达到我们需要的压缩输出的目的了，甚至可以压缩尽75%的内容。
 首先，我们要做的就是检测自己所用的主机是否支持zlib（一个比较通用的压缩库，通过在程序中引入zlib，可以方便的对数据进行压缩），把下面的代码复制到一个新建的.php文件中，不妨叫它为test.php。

&#60;?php phpinfo(); ?&#62;

把test.php页面上传到你的主机,在浏览器中运行这个页面,看看参数中是否支持zlib。我所在的空间显示如下：

如果确定主机支持zlib，那么你可以继续往下做了。
把下面的代码复制到你主题的header文件中，在DOCTYPE之上。
&#60;?php     ini_set(‘zlib.output_compression’, ‘On’);      ini_set(‘zlib.output_compression_level’, ‘1′);      ?&#62;

就是这些，之后去Port80Software.com上看看是否压缩输出了吧。文章译自wprecipes.
]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 默认状态下是不提供压缩代码输出到用户浏览器的，但只要简单的几行代码就可以达到我们需要的压缩输出的目的了，甚至可以压缩尽75%的内容。</p>
<p> <span id="more-264"></span>首先，我们要做的就是检测自己所用的主机是否支持<strong><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/zlib" title="显示zlib的所有日志" target="_blank">zlib</a></span></strong>（一个比较通用的压缩库，通过在程序中引入<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/zlib" title="显示zlib的所有日志" target="_blank">zlib</a></span>，可以方便的对数据进行压缩），把下面的代码复制到一个新建的.php文件中，不妨叫它为test.php。
</p>
<blockquote><h6>&lt;?php <a href="http://www.php.net/phpinfo">phpinfo</a>(); ?&gt;</h6>
</blockquote>
<p>把test.php页面上传到你的主机,在浏览器中运行这个页面,看看参数中是否支持zlib。我所在的空间显示如下：</p>
<p><a href="http://www.xixis.net/wp-content/uploads/2010/02/1261204AU923030I50.jpg" rel="lightbox"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="1261204AU9230-30I50" border="0" alt="1261204AU9230-30I50" src="http://www.xixis.net/wp-content/uploads/2010/02/1261204AU923030I50-150x55.jpg" /></a></p>
<p>如果确定主机支持zlib，那么你可以继续往下做了。</p>
<p>把下面的代码复制到你主题的header文件中，<strong>在DOCTYPE之上</strong>。</p>
<blockquote><h6>&lt;?php     <br /><a href="http://www.php.net/ini_set">ini_set</a>(‘zlib.output_compression’, ‘On’);      <br /><a href="http://www.php.net/ini_set">ini_set</a>(‘zlib.output_compression_level’, ‘1′);      <br />?&gt;</h6>
</blockquote>
<p>就是这些，之后去Port80Software.com上看看是否压缩输出了吧。文章译自wprecipes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/zlib-compression-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.7 启用 GZip压缩输出页面</title>
		<link>http://www.xixis.net/archives/wordpress-2-7-to-enable-gzip-compression-output-page.html</link>
		<comments>http://www.xixis.net/archives/wordpress-2-7-to-enable-gzip-compression-output-page.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 19:29:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.xixis.net/?p=263</guid>
		<description><![CDATA[WordPress 2.5 以后就关闭了 GZip 功能。可以使用以下几种方法中适合自己的方法开启：
 
方法1：
在根目录 index.php 中找到：     define(’WP_USE_THEMES’, true);      在后面加上：      ob_start(’ob_gzhandler’);      就OK了。
也可以加一点条件判断：     if(ereg(’gzip’,$_SERVER['HTTP_ACCEPT_ENCODING'])){ //判断浏览器是否支持Gizp      if(substr($_SERVER['REQUEST_URI'],0,10)!=’/wp-content/uploads/’) //排除不需要Gzip压缩的目录      ob_start(’ob_gzhandler’); //打开Gzip压缩      }

方法2：
如果服务器支持.htaccess文件，那么在wordpress根目录的.htaccess增加以下代码，如果没有.htaccess则新建后增加代码。增加完成后上传到wordpress根目录后即可。     php_value output_handler ob_gzhandler

方法3：
通过php.ini 启用Gzip, 添加如下代码来开启gzip。
output_buffering = Off     output_handler =      zlib.output_compression = On      zlib.output_compression_level = ...]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 2.5 以后就关闭了 GZip 功能。可以使用以下几种方法中适合自己的方法开启：</p>
<p> <span id="more-263"></span>
<p>方法1：</p>
<blockquote><p>在根目录 index.php 中找到：     <br />define(’WP_USE_THEMES’, true);      <br />在后面加上：      <br />ob_start(’ob_gzhandler’);      <br />就OK了。</p>
<p>也可以加一点条件判断：     <br />if(ereg(’<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/gzip" title="显示gzip的所有日志" target="_blank">gzip</a></span>’,$_SERVER['HTTP_ACCEPT_ENCODING'])){ //判断浏览器是否支持Gizp      <br />if(substr($_SERVER['REQUEST_URI'],0,10)!=’/wp-content/uploads/’) //排除不需要Gzip压缩的目录      <br />ob_start(’ob_gzhandler’); //打开Gzip压缩      <br />}</p>
</blockquote>
<p>方法2：</p>
<blockquote><p>如果服务器支持.htaccess文件，那么在wordpress根目录的.htaccess增加以下代码，如果没有.htaccess则新建后增加代码。增加完成后上传到wordpress根目录后即可。     <br />php_value output_handler ob_gzhandler</p>
</blockquote>
<p>方法3：</p>
<blockquote><p>通过php.ini 启用Gzip, 添加如下代码来开启<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/gzip" title="显示gzip的所有日志" target="_blank">gzip</a></span>。</p>
<p>output_buffering = Off     <br />output_handler =      <br />zlib.output_compression = On      <br />zlib.output_compression_level = 6</p>
<p>zlib.output_compression_level = &lt; 任何1—9的值,1的压缩比率最低, 建议取 6&gt;</p>
</blockquote>
<p>需要注意的是如果在.htaccess文件中禁止了gzip功能的话，那在php.ini文件中开启后需在.htaccess文件中开启，否则无效。   <br />开启wordpress的gzip功能后，服务器将在页面传输前将页面压缩后传送，可以有效减少服务器的带宽使用，也可以加速页面下载。    <br />在<a href="http://www.gidnetwork.com/tools/gzip-test.php">这个网站</a>可以查看页面是否启用 GZip，以及启用后页面的压缩率。</p>
<p>我用的GoDaddy的虚拟主机，能够自己重定义 php.ini,如果是PHP5就修改php5.ini~ 用 <a href="http://www.gidnetwork.com/tools/gzip-test.php">http://www.gidnetwork.com/tools/gzip-test.php</a> 查看一下 ~压缩了72.8% ~ 速度也提升了~</p>
<p><a href="http://www.xixis.net/wp-content/uploads/2010/02/wordpress_27_gzip.jpg" rel="lightbox"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wordpress_27_gzip" border="0" alt="wordpress_27_gzip" src="http://www.xixis.net/wp-content/uploads/2010/02/wordpress_27_gzip_thumb.jpg" width="223" height="244" /></a> </p>
<p>注意：这样就可以给所有php文件进行gzip压缩了。注意的是，这样启用gzip之后需要将程序原来的gzip功能去掉，例如discuz等的gzip不要启用，否则程序会报错。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-2-7-to-enable-gzip-compression-output-page.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress插件WP-PageNavi的使用和汉化包下载</title>
		<link>http://www.xixis.net/archives/wordpress-plugin-wp-pagenavi-use-and-the-finished-package-to-download.html</link>
		<comments>http://www.xixis.net/archives/wordpress-plugin-wp-pagenavi-use-and-the-finished-package-to-download.html#comments</comments>
		<pubDate>Sun, 31 Jan 2010 15:24:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[pagenavi]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wp-pagenavi]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.xixis.net/?p=250</guid>
		<description><![CDATA[WP-PageNavi 是由大家熟知的 WordPress 插件专业户 GaMerZ 开发的一款深受用户喜爱的 “WP 翻页”插件，我们知道大多数博客软件都提供了页面底部或者顶部翻页功能，虽然 WordPress 自身也有这个功能，但是过于简单（只能翻至前后页），因此对读者来说有时会造成阅读障碍，而安装 WP-PageNavi 之后就可以彻底解决这一问题。
 

插件简介
该插件可以实现页面底部的翻页功能，并且提供用户自定义功能。最新版本是 2.40 已经支持 WP 2.71，因此用户可以选择安装或者升级。
安装步骤

解压后，将 pagenavi 文件夹上传到 /wp-content/plugins 中 
激活 WP-PageNavi 插件 

使用方法

打开 /wp-content/themes/&#60;YOUR THEME NAME&#62;/footer.php（或者其他文件如 index.php） 
增加下面的代码到合适的地方
PHP代码

&#60;?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi();} ?&#62;&#160; 


到 “WP-Admin -&#62; Options -&#62; PageNavi” 配置 WP-PageNavi 插件的参数      3.1.翻页文本内容      Text For Number Of Pages 总页数      Text For Current Page 当前页      Text For Page 页数      Text For First Post 首页  ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://lesterchan.net/wordpress/readme/wp-pagenavi.html">WP-PageNavi</a> 是由大家熟知的 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e6%8f%92%e4%bb%b6" title="显示插件的所有日志" target="_blank">插件</a></span>专业户 <a href="http://lesterchan.net/">GaMerZ</a> 开发的一款深受用户喜爱的 “WP 翻页”<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e6%8f%92%e4%bb%b6" title="显示插件的所有日志" target="_blank">插件</a></span>，我们知道大多数博客软件都提供了页面底部或者顶部翻页功能，虽然 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/wordpress" title="显示WordPress的所有日志" target="_blank">WordPress</a></span> 自身也有这个功能，但是过于简单（只能翻至前后页），因此对读者来说有时会造成阅读障碍，而安装 WP-PageNavi 之后就可以彻底解决这一问题。</p>
<p> <span id="more-250"></span>
</p>
<p><strong><span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e6%8f%92%e4%bb%b6" title="显示插件的所有日志" target="_blank">插件</a></span>简介</strong></p>
<p>该插件可以实现页面底部的翻页功能，并且提供用户自定义功能。<a href="http://lesterchan.net/wordpress/readme/wp-pagenavi.html">最新版本</a>是 <a href="http://lesterchan.net/others/downloads.php?id=11">2.40</a> 已经支持 WP 2.71，因此用户可以选择安装或者升级。</p>
<p><strong>安装步骤</strong></p>
<ol>
<li>解压后，将 <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/pagenavi" title="显示pagenavi的所有日志" target="_blank">pagenavi</a></span> 文件夹上传到 /wp-content/plugins 中 </li>
<li>激活 WP-PageNavi 插件 </li>
</ol>
<p><strong>使用方法</strong></p>
<ol>
<li>打开 /wp-content/themes/&lt;YOUR THEME NAME&gt;/footer.php（或者其他文件如 index.php） </li>
<li>增加下面的代码到合适的地方
<p>PHP代码</p>
<ol>
<li>&lt;?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi();} ?&gt;&#160; </li>
</ol>
</li>
<li>到 “WP-Admin <strong>-&gt; </strong>Options<strong> -&gt; </strong>PageNavi” 配置 WP-PageNavi 插件的参数      <br />3.1.翻页文本内容      <br />Text For Number Of Pages 总页数      <br />Text For Current Page 当前页      <br />Text For Page 页数      <br />Text For First Post 首页      <br />Text For Last Post 尾页      <br />Text For Next Post 下一页      <br />Text For Previous Post 上一页      <br />Text For Next … 下      <br />Text For Previous … 上      <br />3.2.翻页显示选项      <br />Page Navigation Style 普通（横排列表）和下拉（Drop Down List）      <br />Number Of Many Pages To Show 直接显示页的数量      <br />Always Show Page Navigation 是否总是显示翻页功能 </li>
<li>如果需要修改 WP-PageNavi CSS 可以对下面的文件进行修改
<p>XML/HTML代码</p>
<ol>
<li>/wp-content/plugins/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/pagenavi" title="显示pagenavi的所有日志" target="_blank">pagenavi</a></span>/<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/pagenavi" title="显示pagenavi的所有日志" target="_blank">pagenavi</a></span>-css.css&#160; </li>
</ol>
</li>
<li>卸载插件：Uninstall WP-PageNavi 可以方便的删除该插件（操作时请慎重） </li>
</ol>
<p><strong>升级方法</strong></p>
<ol>
<li>禁用 WP-PageNavi 插件 </li>
<li>打开 wp-content/plugins 文件夹 </li>
<li>上传并覆盖文件夹 pagenavi</li>
<li>删除文件 pagenavi.php </li>
<li>激活 WP-PageNavi 插件 </li>
</ol>
<p>以上是从筷子的博客转载来，因已无此站点故取消失效链接。</p>
<p>以下为<a href="http://roamlog.cn">漫步</a>朋友汉化的 <a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.20</a>，压缩包里自带 po 和 mo 文件。</p>
<p> 点击下载<a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.20</a>中文汉化包：<strong><a href="http://roamlog.cn/download/4/">wp-pagenavi-zh_CN.zip</a>(此2.20版链接已失效)</strong></p>
<p><strong>2009年2月14日更新：</strong></p>
<p><strong></strong> 原本这篇文章是写<a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.20</a> 汉化的，从08年5月20日至今已半年多了，<a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.40</a> 也出了很久了。更新后看到有朋友写的如何使用英文版的教程，但并不太准确。于是自己又动手汉化了下<a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.40</a>，当时汉化好后放到自己的博客里试用却发现显示的是乱码。可以肯定的是编码问题，但自己明明设置了utf-8呀，怎么回事呢？找了同事问了下，也是说编码问题，把我汉化的文件重新传一遍即可。</p>
<p>可是重新传了之后发现问题依旧，于是放下了好多天没有理它。今天突然想到是不是editplus把源文件的编码更改了？于是在editplus下更改了源文件的编码为utf-8后上传，问题解决：)</p>
<p>同时感谢<a href="http://an-liu.cn/">anliu</a>童鞋的评论，那段代码是转载过来的，所以引号问题一直没有重视，今天看了下确实是写错了，用的是中文下的字符。此bug已经修改，谢谢!</p>
<p>这篇文章原本的内容更新较少，仅将一些失效链接或过期的无用文字删去或修改了一下。</p>
<p>严格来说，我是个英盲+程序盲。所以<a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.40</a>汉化文件只是根据我个人的习惯制作(部分卸载时提示的警示语没汉化)，并未参考<a href="http://roamlog.cn">漫步</a>汉化的 <a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.20</a>包或其他朋友汉化的其他版本。所以汉化不一定准确，如果你在使用上有何建议，欢迎反馈给我~</p>
<p>点击下载<a href="http://lesterchan.net/portfolio/programming.php">WP-PageNavi 2.40</a>中文汉化包：<strong><a href="http://cid-d929b35aa2b0b6df.skydrive.live.com/self.aspx/.Public/wp-pagenavi-zh%7C_cn.rar">wp-pagenavi-2.4.0-zh_cn.rar</a> </strong></p>
<p>另附<a href="http://skydao.com/">淡包</a>朋友的 <a href="http://skydao.com/post/wp-pagenavi-240-chinese-package/">wp-pagenavi 2.40 中文汉化包</a> 下载</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-plugin-wp-pagenavi-use-and-the-finished-package-to-download.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress插件之All in One SEO Pack</title>
		<link>http://www.xixis.net/archives/wordpress-plug-in-of-the-all-in-one-seo-pack-overall-optimization-of-your-wordpress-blog.html</link>
		<comments>http://www.xixis.net/archives/wordpress-plug-in-of-the-all-in-one-seo-pack-overall-optimization-of-your-wordpress-blog.html#comments</comments>
		<pubDate>Sun, 31 Jan 2010 14:09:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.xixis.net/?p=249</guid>
		<description><![CDATA[转载由：http://blogunion.org/wordpress/wordpress-plugins/all-in-one-seo-pack.html
一，什么是All in One SEO Pack？
All in One SEO Pack，wordpress的一个seo插件，用这一个插件你就可以实现wordpress的整体优化。
 

不需要title插件，meta插件，tag插件，也不需要DupPrevent Plugin插件，更不用担心因为插件的交替所带来的一堆麻烦。
二，All in One SEO Pack有什么作用？

1、可以给每篇文章添加独立的关键词； 
2、可以给每篇文章添加独立的meta标签； 
3、可以给每篇文章添加独立的description； 
4、可以给每篇文章添加独立的摘要； 
5、可以给每篇文章自动生成摘要； 
6、可以防止存档页和首页的内容被抓取，从而防止因重复内容被google降权； 

三，如何安装使用All in One SEO Pack？

1、下载All in One SEO Pack并解压，上传到plugin目录； 
2、登录wordpress后台控制面板激活该插件； 
3、在选项菜单里面找到all in one seo选项，把里面的空白内容填完，详细填写内容见下图。
 
Home Title：填写博客标题，如“博客联盟，致力于帮助博客新手 – BlogUnion.Org”；         Home Description：则填博客的描述；         Home Keywords：填写博客的关键词，最好不要填太多，50个词组以内；         Rewrite Titles：指标题要不要重写，如果选中的话，标题的前半部分是博客文章的题目，后半部分则是博客的名则，用“&#124;”分隔开，如博客联盟的是“同城博客秀，找到你身边的博客 &#124; 博客联盟”；         Use Categories for META keywords： 把分类作为meta关键词，推荐选中；       ...]]></description>
			<content:encoded><![CDATA[<h5>转载由：<a title="http://blogunion.org/wordpress/wordpress-plugins/all-in-one-seo-pack.html" href="http://blogunion.org/wordpress/wordpress-plugins/all-in-one-seo-pack.html">http://blogunion.org/wordpress/wordpress-plugins/all-in-one-seo-pack.html</a></h5>
<h5>一，什么是All in One <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/seo" title="显示SEO的所有日志" target="_blank">SEO</a></span> Pack？</h5>
<p><a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/">All in One SEO Pack</a>，wordpress的一个seo<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e6%8f%92%e4%bb%b6" title="显示插件的所有日志" target="_blank">插件</a></span>，用这一个<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/%e6%8f%92%e4%bb%b6" title="显示插件的所有日志" target="_blank">插件</a></span>你就可以实现wordpress的整体优化。</p>
<p> <span id="more-249"></span>
</p>
<p>不需要title插件，meta插件，tag插件，也不需要DupPrevent Plugin插件，更不用担心因为插件的交替所带来的一堆麻烦。</p>
<h5>二，All in One <span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/seo" title="显示SEO的所有日志" target="_blank">SEO</a></span> Pack有什么作用？</h5>
<ul>
<li>1、可以给每篇文章添加独立的关键词； </li>
<li>2、可以给每篇文章添加独立的meta标签； </li>
<li>3、可以给每篇文章添加独立的description； </li>
<li>4、可以给每篇文章添加独立的摘要； </li>
<li>5、可以给每篇文章自动生成摘要； </li>
<li>6、可以防止存档页和首页的内容被抓取，从而防止因重复内容被google降权； </li>
</ul>
<h5>三，如何安装使用All in One SEO Pack？</h5>
<ul>
<li>1、下载<a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/">All in One SEO Pack</a>并解压，上传到<span class='wp_keywordlink_affiliate'><a href="http://www.xixis.net/archives/tag/plugin" title="显示plugin的所有日志" target="_blank">plugin</a></span>目录； </li>
<li>2、登录wordpress后台控制面板激活该插件； </li>
<li>3、在选项菜单里面找到all in one seo选项，把里面的空白内容填完，详细填写内容见下图。
<p><a href="http://www.xixis.net/wp-content/uploads/2010/01/allinoneseopack.gif" rel="lightbox"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="all-in-one-seo-pack" border="0" alt="all-in-one-seo-pack" src="http://www.xixis.net/wp-content/uploads/2010/01/allinoneseopack_thumb.gif" width="497" height="439" /></a> </p>
<p><strong>Home Title</strong>：填写博客标题，如“博客联盟，致力于帮助博客新手 – BlogUnion.Org”；         <br /><strong>Home Description</strong>：则填博客的描述；         <br /><strong>Home Keywords</strong>：填写博客的关键词，最好不要填太多，50个词组以内；         <br /><strong>Rewrite Titles</strong>：指标题要不要重写，如果选中的话，标题的前半部分是博客文章的题目，后半部分则是博客的名则，用“|”分隔开，如博客联盟的是“同城博客秀，找到你身边的博客 | 博客联盟”；         <br /><strong>Use Categories for META keywords</strong>： 把分类作为meta关键词，推荐选中；         <br /><strong>Use Category Description as Title</strong>：把分类描述作为标题，不推荐选中；         <br /><strong>Use noindex for Categories</strong>：分类页面不抓取，推荐选中；         <br /><strong>Use noindex for Archives</strong>：存档页面不抓取，推荐选中；         <br /><strong>Autogenerate Descriptions</strong>：自动生成摘要，不推荐选中，建议手动填写，把精华内容加进去；         <br /><strong>Max Number of Words in Auto-Generated Descriptions</strong>：摘要的最大文字数，建议修改为50。</p>
</li>
<li>4、在撰写文章界面，添加关键字，摘要。 </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.xixis.net/archives/wordpress-plug-in-of-the-all-in-one-seo-pack-overall-optimization-of-your-wordpress-blog.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

