<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>明泉 &#187; WordPress</title>
	<atom:link href="http://liumingquan.net/html/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://liumingquan.net</link>
	<description>开尽春花芳草涧 遍通秋水月明泉</description>
	<lastBuildDate>Fri, 16 Jul 2010 05:37:44 +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>wp_list_categories</title>
		<link>http://liumingquan.net/html/2010_02/wp_list_categories.html</link>
		<comments>http://liumingquan.net/html/2010_02/wp_list_categories.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 06:29:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_list_categories]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2010_02/wp_list_categories.html</guid>
		<description><![CDATA[wp_list_categories 是 WordPress 中列出分类目录的一个函数。WordPress 中的文章被存放在不同的分类目录下，在 CMS 中，分类目录通常被称之为“栏目”。如果用户要修改或制作一个 WordPress 模板，wp_list_categories 是注定要被用到的一个函数。
普通用法

&#60;?PHP
	//用法1
	wp_list_categories&#40;&#41;;
&#160;
	//用法2
	$CategoriesInfo = array&#40;&#41;;
	wp_list_categories&#40;$CategoriesInfo&#41;;
?&#62;

参数说明：
一、和分类目录数量有关的参数
和分类目录数量有关的参数有三个，分别是 exclude、include、number。
exclude：
按照分类目录的 ID 排除分类目录。参数为1个或者多个数字，显示出来的分类目录中，如果某个或者某几个分类目录的 ID 和参数中指定的数字相等，则这些分类目录不会被显示出来。
用法

&#60;?PHP
	//不显示Id为1的目录
	wp_list_categories&#40;'exclude=1'&#41;;
&#160;
	//不显示Id为3、4、5的分类目录
	wp_list_categories&#40;'exclude=3,4,5'&#41;;
&#160;
	//不显示Id为3、4、6的分类目录
	$CategoriesInfo = array&#40;'exclude' =&#62; '3,4,6'&#41;;
	wp_list_categories&#40;$CategoriesInfo&#41;;
?&#62;

include：
设置 include 为分类目录的 ID，则只显示经 include 指定的分类目录(不包括这个 ID 所指分类目录的下级目录)。include 的优先级大于 exclude，当参数设置为include=1&#038;exclude=1的时候(看起来这种设置很无厘头)，则 ID 为1的分类目录被显示出来。
用法

&#60;?PHP
	//只显示id为1的分类目录
	wp_list_categories&#40;'include=1'&#41;;
&#160;
	//只显示id为2,3的分类目录
	wp_list_categories&#40;'include=2,3'&#41;;
&#160;
	//只显示Id为3、4、6的分类目录
	$CategoriesInfo	= array&#40;'include' =&#62; '3,4,6'&#41;;
	wp_list_categories&#40;$CategoriesInfo&#41;;
?&#62;

number
所显示的分类目录的数量。为数字。默认没有限制。number 的优先级大于 include，当 include 中设置的应显示出来的分类目录的数量大于 number 中设置的值时，以 number 设置的值为准。
用法：

&#60;?PHP
	//只显示出来3个分类目录
	wp_list_categories&#40;'number=3'&#41;;
&#160;
	//只显示出来id为1、2、3的分类目录
	//(尽管include希望显示出来7个分类目录，但number的优先级大于include)
	wp_list_categories&#40;'include=1,2,3,4,5,6,7&#38;number=3'&#41;;
&#160;
	//只显示出来id为1、2、3、4的分类目录
	//(尽管include希望显示出来7个分类目录，但number的优先级大于include)
	$CategoriesInfo = array&#40; 'include' =&#62; '1,2,3,4,5,6,7',
				 'number' =&#62;  '4'&#41;;
	wp_list_categories&#40;$CategoriesInfo&#41;;
?&#62;

二、和分类目录排序有关的参数
和分类目录排序有关的参数有两个，orderby 和 order
orderby：
所列出来的分类目录排序的依据。参数可以是‘ID’、‘name’或‘count’，分别是按照分类目录的 ID、名称和文章数量来排序。其默认值是‘ID’。
order：
所列出来分类目录排序的方式，升序还是降序，参数可以是‘ASC’或‘DESC’，默认值是‘ASC’升序。
用法

&#60;?PHP
	//按照ID的降序排列
	wp_list_categories&#40;'orderby=ID&#38;order=DESC'&#41;;
&#160;
	//按照ID的升序排列
	wp_list_categories&#40;'orderby=ID&#38;order=ASC'&#41;;
&#160;
	//按照分类目录名称的升序排列
	wp_list_categories&#40;'orderby=name&#38;order=ASC'&#41;;
&#160;
	//按照文章数量的降序排列
	$CategoriesInfo [...]]]></description>
			<content:encoded><![CDATA[<p>wp_list_categories 是 WordPress 中列出分类目录的一个函数。WordPress 中的文章被存放在不同的分类目录下，在 CMS 中，分类目录通常被称之为“栏目”。如果用户要修改或制作一个 WordPress 模板，wp_list_categories 是注定要被用到的一个函数。<span id="more-284"></span></p>
<p>普通用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//用法1</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//用法2</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>参数说明：</p>
<p><strong>一、和分类目录数量有关的参数</strong><br />
和分类目录数量有关的参数有三个，分别是 exclude、include、number。</p>
<p>exclude：<br />
按照分类目录的 ID 排除分类目录。参数为1个或者多个数字，显示出来的分类目录中，如果某个或者某几个分类目录的 ID 和参数中指定的数字相等，则这些分类目录不会被显示出来。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//不显示Id为1的目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//不显示Id为3、4、5的分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude=3,4,5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//不显示Id为3、4、6的分类目录</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'3,4,6'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>include：<br />
设置 include 为分类目录的 ID，则只显示经 include 指定的分类目录(不包括这个 ID 所指分类目录的下级目录)。include 的优先级大于 exclude，当参数设置为include=1&#038;exclude=1的时候(看起来这种设置很无厘头)，则 ID 为1的分类目录被显示出来。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//只显示id为1的分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//只显示id为2,3的分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include=2,3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//只显示Id为3、4、6的分类目录</span>
	<span style="color: #000088;">$CategoriesInfo</span>	<span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'3,4,6'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>number<br />
所显示的分类目录的数量。为数字。默认没有限制。number 的优先级大于 include，当 include 中设置的应显示出来的分类目录的数量大于 number 中设置的值时，以 number 设置的值为准。</p>
<p>用法：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//只显示出来3个分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'number=3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//只显示出来id为1、2、3的分类目录</span>
	<span style="color: #008000; font-style: normal;">//(尽管include希望显示出来7个分类目录，但number的优先级大于include)</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include=1,2,3,4,5,6,7&amp;number=3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//只显示出来id为1、2、3、4的分类目录</span>
	<span style="color: #008000; font-style: normal;">//(尽管include希望显示出来7个分类目录，但number的优先级大于include)</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'include'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1,2,3,4,5,6,7'</span><span style="color: #339933;">,</span>
				 <span style="color: #0000ff;">'number'</span> <span style="color: #339933;">=&gt;</span>  <span style="color: #0000ff;">'4'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p><strong>二、和分类目录排序有关的参数</strong><br />
和分类目录排序有关的参数有两个，orderby 和 order</p>
<p>orderby：<br />
所列出来的分类目录排序的依据。参数可以是‘ID’、‘name’或‘count’，分别是按照分类目录的 ID、名称和文章数量来排序。其默认值是‘ID’。</p>
<p>order：<br />
所列出来分类目录排序的方式，升序还是降序，参数可以是‘ASC’或‘DESC’，默认值是‘ASC’升序。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//按照ID的降序排列</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'orderby=ID&amp;order=DESC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//按照ID的升序排列</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'orderby=ID&amp;order=ASC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//按照分类目录名称的升序排列</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'orderby=name&amp;order=ASC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//按照文章数量的降序排列</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'count'</span><span style="color: #339933;">,</span>
				 <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span>  <span style="color: #0000ff;">'DESC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p><strong>三、和 feed 有关的参数</strong><br />
和 feed 有关的参数有两个， feed 和 feed_image</p>
<p>feed：<br />
是否显示分类目录的 rss 链接。为字符串，feed所指定的字符串为链接的文字，默认不显示。</p>
<p>feed_image：<br />
为 rss 链接设置一个图标。为字符串，一般情况下是一个图片文件的相对或绝对地址。默认不显示。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//显示 rss 链接</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'feed=RSS'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//显示 rss 链接，并有小图标显示</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'feed=RSS&amp;feed_image=/wp-content/themes/default/images/rss.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//显示 rss 链接，并有小图标显示</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span>	<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'feed'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'RSS'</span><span style="color: #339933;">,</span>
				  <span style="color: #0000ff;">'feed_image'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/wp-content/themes/default/images/rss.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p><strong>四、和显示样式（方式）有关的参数</strong></p>
<p>style：<br />
分类目录是以列表的方式显示出来，还是以没有任何样式的方式显示出来。参数为list或者none，默认是list，是以ui、li列表方式显示出来，如果设置为none，则没有任何样式，分类列表之间以“<br />”分割。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//以列表的方式显示</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'style=list'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//以“&lt;br /&gt;”分割</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'style=none'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>depth：<br />
参数为数字，可以是1、2、3、&#8230;n，或者是0和-1，默认值为0。当depth为正整数的时候，可以控制显示几层分类，例如depth为1，则只显示一层分类，如depth为2，则显示一层分类及这层分类之下的子分类。如果设置depth为-1时，不同级别的分类目录是在一个ul之中的同级别的li，当depth为0时，不同级别的分类是嵌套在不同ul之间的li。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//不同级别的分类目录在同一个ul之中同一级别的li之中显示</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'depth=-1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//不同级别的分类目录在不同的ul之中同一级别的li之中显示</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'depth=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//显示两个级别的分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'depth=2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>hierarchical：<br />
数字，1或者0，默认为1，为1的时候，不同级别的分类目录现在在互相嵌套的ul和li中，为0的时候，不同级别的分类目录显示在同一级别的ul和li中。hierarchical和depth有点相似，两者一起使用并且矛盾的话，分类目录总是显示在同级的ul之下。</p>
<table border="1" align="center">
<tr>
<td>depth</td>
<td>0</td>
<td>-1</td>
<td>NULL</td>
<td>NULL</td>
<td>0</td>
<td>-1</td>
<td>0</td>
<td>-1</td>
</tr>
<tr>
<td>hierarchical</td>
<td>NULL</td>
<td>NULL</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>嵌套ul</td>
<td>同级ul</td>
<td>同级ul</td>
<td>嵌套ul</td>
<td>嵌套ul</td>
<td>同级ul</td>
<td>同级ul</td>
<td>同级ul</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>hierarchical优先</td>
<td>depth优先</td>
</tr>
</table>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//不同级别的分类目录出现在互相嵌套的ul和li中</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hierarchical=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//不同级别的分类目录出现在同一级别的ul和li中</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'hierarchical'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>show_count<br />
是否显示出来分类目录中所包含的文章数量，参数为1或者0，默认为0，不显示文章数量，如果设置为1，则显示出来文章数量。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//显示出来文章数量</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'show_count=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//不显示出来文章数量</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'show_count=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>show_option_all：<br />
在wp_list_categories中使用show_option_all参数的话，在所有分类目录之前，将产生一个到博客首页的链接，链接的文字就是show_option_all所指定的值。<br />
<?PHP<br />
	//用法<br />
	wp_list_categories('show_option_all=首页');<br />
?></p>
<p><strong>五、和标题有关的参数</strong></p>
<p>title_li<br />
在分类目录之前显示标题。默认值为po文件中Categories所对应的译文，官方中文版po文件中Categories的译文是“分类目录”，也可以设置为其他的值。当style设置为none的时候，title_li不起作用。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//显示“栏目”</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=栏目'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//显示po文件中Categories所对应的译文</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'title_li'</span><span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Categories'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p><strong>六、其他参数</strong></p>
<p>child_of：<br />
参数为数字，功能为显示指定父分类 ID 下的子分类，无默认值。假设某个分类的id为6，将child_of设置为6时，则只显示这个分类下的子分类。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//显示ID为6的分类目录的下一级分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span>child_of<span style="color: #339933;">=</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//显示ID为1的分类目录的下一级分类目录</span>
	<span style="color: #000088;">$CategoriesInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'child_of'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CategoriesInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>echo：<br />
参数为数字，1或者0，默认是1。如果是1的话，wp_list_categories函数将分类目录正常显示出来。如果是0的话，使用wp_list_categories函数的结果会产生一个变量，显示这个变量的时候才显示出来分类目录。</p>
<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//如果将echo设置为0，需要增加echo以便显示出来分类目录</span>
	<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'echo=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//如果将echo设置为1，则直接可以显示出来分类目录</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'echo=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//其实echo的默认值就是1，所以可以直接用如下的写法</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>hide_empty：<br />
数字，1或者0，默认为1。控制是否显示还没有文章的分类目录。默认为1，不显示没有文章的分类目录，当设置为0的时候，显示没有文章的分类目录。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//显示所有分类目录链接(不管这些分类目录是否包含文章)</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hide_empty=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//只显示包含有文章的分类目录链接</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hide_empty=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p>use_desc_for_title<br />
分类目录的描述信息，是否加入到分类目录链接的 title 标签中。可以设置为1或者0，1为默认值，加入title标签，内容为分类目录的描述信息，0为不加入。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?PHP</span>
	<span style="color: #008000; font-style: normal;">//加入title标签</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'use_desc_for_title=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: normal;">//不加入title信息</span>
	<span style="color: #800000; font-weight: normal;">wp_list_categories</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'use_desc_for_title=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #800000; font-weight: normal;">?&gt;</span></pre></div></div>

<p><strong>七、有疑问的参数</strong></p>
<p>show_last_update<br />
官方的文档中说这个参数是显示分类中日志的最新时间戳，可以是1或者0。但是我没有试验出来这个参数的效果。并且发现<a href="http://codex.wordpress.org/Template_Tags/wp_list_categories" target="_blank">官方文档</a>中也有一些BUG。官方文档的示例中写的是：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:"",monospace;">    <span style="color: #0000ff;">'show_last_update'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span></pre></div></div>

<p>但同一页面的下边解释这个参数的时候，却是：<br />
show_last_updated<br />
    (boolean) Should the last updated timestamp for posts be displayed (TRUE) or not (FALSE). Defaults to FALSE.</p>
<p>        * 1 (True)<br />
        * 0 (False) &#8211; Default </p>
<p>能够看到，show_last_update变成了show_last_updated，不过这两个我都没有试出来效果。有知道的朋友可以给我留言，谢谢。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2010_02/wp_list_categories.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress发布2.8.6</title>
		<link>http://liumingquan.net/html/2009_11/wordpress-release-2-8-6.html</link>
		<comments>http://liumingquan.net/html/2009_11/wordpress-release-2-8-6.html#comments</comments>
		<pubDate>Fri, 13 Nov 2009 02:15:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[2.8.6]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009_11/wordpress%e5%8f%91%e5%b8%832-8-6.html</guid>
		<description><![CDATA[WordPress 是一个注重美学、易用性和网络标准的个人信息发布平台。在国内有大量用户作为自己博客的首选建站程序。WordPress 为免费的开源软件，但其价值是无法用金钱来衡量。使用 WordPress 可以搭建功能强大的网络信息发布平台，但更多的是应用于个性化的博客。针对博客的应用，WordPress 能让您省却对后台技术的担心，集中精力做好网站的内容。
2009年11月13日，WordPress发布了2.8.6英文版。中文版暂时没有发布。WordPress用户也可以通过自动升级的功能将现有版本升级为2.8.6。
]]></description>
			<content:encoded><![CDATA[<p>WordPress 是一个注重美学、易用性和网络标准的个人信息发布平台。在国内有大量用户作为自己博客的首选建站程序。WordPress 为免费的开源软件，但其价值是无法用金钱来衡量。使用 WordPress 可以搭建功能强大的网络信息发布平台，但更多的是应用于个性化的博客。针对博客的应用，WordPress 能让您省却对后台技术的担心，集中精力做好网站的内容。<span id="more-240"></span></p>
<p>2009年11月13日，<a href="http://wordpress.org/download/" target="_blank">WordPress发布了2.8.6英文版</a>。中文版暂时没有发布。WordPress用户也可以通过自动升级的功能将现有版本升级为2.8.6。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_11/wordpress-release-2-8-6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将WordPress默认模板宽度改成960px</title>
		<link>http://liumingquan.net/html/2009_06/wordpress-default-template-will-be-changed-to-960px-width.html</link>
		<comments>http://liumingquan.net/html/2009_06/wordpress-default-template-will-be-changed-to-960px-width.html#comments</comments>
		<pubDate>Fri, 05 Jun 2009 07:15:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[960px]]></category>
		<category><![CDATA[宽度]]></category>
		<category><![CDATA[默认主题]]></category>
		<category><![CDATA[默认模板]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/06/%e5%b0%86wordpress%e9%bb%98%e8%ae%a4%e6%a8%a1%e6%9d%bf%e5%ae%bd%e5%ba%a6%e6%94%b9%e6%88%90960px.html</guid>
		<description><![CDATA[我曾经把WodrPress的默认模板文章页加入了侧边栏，当时提到这么做的另外一个目的就是准备把WordPress的默认模板由760px（适应800*600及以上的分辨率）改为960px（适应1024*768及以上的分辨率）。毕竟现在使用800*600分辨率的显示器的用户所占比例很小，而17寸普屏，19寸普屏，19寸宽屏，22寸宽屏和14.1寸高分宽屏的笔记本的用户占相对多数。这样做可以让页面两边的空白减少，同屏显示的文字增多(需要对翻页插件的每页显示文章数做调整)。
更改css文件：
编辑wp-content\themes\default目录下的style.css文件，修改如下几个地方，

42
43
44
45
46
#headerimg 	&#123;
	margin: 7px 9px 0;
	height: 192px;
	width: 740px;
	&#125;

将 #headerimg中的width由740px改为940px；

237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#page &#123;
	background-color: white;
	margin: 20px auto;
	padding: 0;
	width: 760px;
	border: 1px solid #959596;
	&#125;
&#160;
#header &#123;
	background-color: #73a0c5;
	margin: 0 0 0 1px;
	padding: 0;
	height: 200px;
	width: 758px;
	&#125;

将#page中width由760px改为960px，将#header中width由758px改为958px；

259
260
261
262
263
264
265
266
267
268
269
270
.narrowcolumn &#123;
	float: left;
	padding: 0 0 20px 45px;
	margin: 0px 0 0;
	width: 450px;
	&#125;
&#160;
.widecolumn &#123;
	padding: 10px 0 20px 0;
	margin: 5px 0 0 150px;
	width: 450px;
	&#125;

将 .narrowcolumn和.widecolumn中的width由450px改为650px，这个操作直接让文章内容区域变宽；

313
314
315
316
317
318
#footer &#123;
	padding: 0;
	margin: 0 auto;
	width: 760px;
	clear: both;
	&#125;

将 #footer中的width由760px改为960px，这是在操作页尾；

574
575
576
577
578
579
#sidebar
&#123;
	padding: 20px [...]]]></description>
			<content:encoded><![CDATA[<p>我曾经把WodrPress的<a href="http://liumingquan.net/html/2009_05/so-that-the-article-appears-in-the-sidebar-on-page.html" target="_blank">默认模板文章页加入了侧边栏</a>，当时提到这么做的另外一个目的就是准备把WordPress的默认模板由760px（适应800*600及以上的分辨率）改为960px（适应1024*768及以上的分辨率）。毕竟现在使用800*600分辨率的显示器的用户所占比例很小，而17寸普屏，19寸普屏，19寸宽屏，22寸宽屏和14.1寸高分宽屏的笔记本的用户占相对多数。这样做可以让页面两边的空白减少，同屏显示的文字增多(需要对翻页插件的每页显示文章数做调整)。<span id="more-81"></span></p>
<p><strong>更改css文件：</strong><br />
编辑wp-content\themes\default目录下的style.css文件，修改如下几个地方，</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>42
43
44
45
46
</pre></td><td class="code"><pre class="css" style="font-family:"",monospace;"><span style="color: #cc00cc;">#headerimg</span> 	<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">7px</span> <span style="color: #933;">9px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">192px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">740px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>将 #headerimg中的width由740px改为940px；</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
</pre></td><td class="code"><pre class="css" style="font-family:"",monospace;"><span style="color: #cc00cc;">#page</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</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;">760px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#959596</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#73a0c5</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">758px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>将#page中width由760px改为960px，将#header中width由758px改为958px；</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>259
260
261
262
263
264
265
266
267
268
269
270
</pre></td><td class="code"><pre class="css" style="font-family:"",monospace;"><span style="color: #6666ff;">.narrowcolumn</span> <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;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span> <span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #cc66cc;">0</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;">450px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.widecolumn</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</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: #cc66cc;">0</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">450px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>将 .narrowcolumn和.widecolumn中的width由450px改为650px，这个操作直接让文章内容区域变宽；</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>313
314
315
316
317
318
</pre></td><td class="code"><pre class="css" style="font-family:"",monospace;"><span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">760px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>将 #footer中的width由760px改为960px，这是在操作页尾；</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>574
575
576
577
578
579
</pre></td><td class="code"><pre class="css" style="font-family:"",monospace;"><span style="color: #cc00cc;">#sidebar</span>
<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">545px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">190px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>将#sidebar中的margin-left由545px改为745px，这一行是侧边栏距页面左边的距离，因为页面左边的宽度增加了200，所以这里也要增加200，否则侧边栏就会和内容区域离得很近。</p>
<p><strong>更改图片：</strong><br />
编辑wp-content\themes\default\images目录下kubrickbg-ltr.jpg、kubrickbg-rtl.jpg、kubrickbgwide.jpg，kubrickfooter.jpg和kubrickheader.jpg文件，将其宽度由760改为960。</p>
<p><strong>更改header-img.php：</strong><br />
有人认为wp-content\themes\default\images中header-img.php文件也要做出适当修改，我认为在没有改动过“外观”-“头部图像和颜色”设置的模板，是不用修改header-img.php文件的。</p>
<p>我将已经完成上述更改的css和图片文件打包放上来，有需要的朋友可以直接下载：<br />
<a href="http://cid-c8ed248a10c0729b.skydrive.live.com/browse.aspx/.Public/WordPress/2009" target="_blank">已经做好上述修改的css文件</a> (10KB)<br />
<a href="http://cid-c8ed248a10c0729b.skydrive.live.com/browse.aspx/.Public/WordPress/2009" target="_blank">已经做好上述修改的图片文件</a> (17KB)</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_06/wordpress-default-template-will-be-changed-to-960px-width.html/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>让侧边栏出现在文章页</title>
		<link>http://liumingquan.net/html/2009_05/so-that-the-article-appears-in-the-sidebar-on-page.html</link>
		<comments>http://liumingquan.net/html/2009_05/so-that-the-article-appears-in-the-sidebar-on-page.html#comments</comments>
		<pubDate>Sun, 31 May 2009 07:47:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[侧边栏]]></category>
		<category><![CDATA[文章页]]></category>
		<category><![CDATA[默认模板]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/%e8%ae%a9%e4%be%a7%e8%be%b9%e6%a0%8f%e5%87%ba%e7%8e%b0%e5%9c%a8%e6%96%87%e7%ab%a0%e9%a1%b5.html</guid>
		<description><![CDATA[WordPress的默认模板很简洁清爽。明泉比较喜欢这种设计，所以一直没有更换其他的模板。但默认的模板有一个很小的问题是文章页没有侧边栏。解决这个问题也很简单。下载wp-content\themes\default目录下的single.php文件到本地，打开此文件， 并且编辑第三行，把

3
&#60;div id=&#34;content&#34; class=&#34;widecolumn&#34;&#62;

修改成

3
&#60;div id=&#34;content&#34; class=&#34;narrowcolumn&#34;&#62;

之后在single.php文件的62和64行之间

62
63
64
	&#60;/div&#62;
&#160;
&#60;?php get_footer(); ?&#62;

增加一行，修改成：

62
63
64
	&#60;/div&#62;
&#60;?php get_sidebar(); ?&#62;
&#60;?php get_footer(); ?&#62;

将此文件上传到服务器。覆盖以前的文件。因为我启用了cos-html-cache插件，所以还要在插件的设置页面，删掉以前所有的缓存页面。然后回到首页，点开任何一个文章页，会发现文章页中已经出现了侧边栏。
这么做，其实还有另外一个目的，就是准备把默认模板的宽度从760px（适应800*600的分辨率）改成960px（适应1024*768的分辨率）。
ps：五天之后，我做了上述修改。
]]></description>
			<content:encoded><![CDATA[<p>WordPress的默认模板很简洁清爽。明泉比较喜欢这种设计，所以一直没有更换其他的模板。但默认的模板有一个很小的问题是文章页没有侧边栏。解决这个问题也很简单。下载wp-content\themes\default目录下的single.php文件到本地，打开此文件， 并且编辑第三行，把<span id="more-68"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
</pre></td><td class="code"><pre class="html" style="font-family:"",monospace;">&lt;div id=&quot;content&quot; class=&quot;widecolumn&quot;&gt;</pre></td></tr></table></div>

<p>修改成</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
</pre></td><td class="code"><pre class="html" style="font-family:"",monospace;">&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt;</pre></td></tr></table></div>

<p>之后在single.php文件的62和64行之间</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>62
63
64
</pre></td><td class="code"><pre class="html" style="font-family:"",monospace;">	&lt;/div&gt;
&nbsp;
&lt;?php get_footer(); ?&gt;</pre></td></tr></table></div>

<p>增加一行，修改成：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>62
63
64
</pre></td><td class="code"><pre class="html" style="font-family:"",monospace;">	&lt;/div&gt;
&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;</pre></td></tr></table></div>

<p>将此文件上传到服务器。覆盖以前的文件。因为我启用了<a href="http://liumingquan.net/html/2009_05/cos-html-cache.html" target="_blank">cos-html-cache</a>插件，所以还要在插件的设置页面，删掉以前所有的缓存页面。然后回到首页，点开任何一个文章页，会发现文章页中已经出现了侧边栏。</p>
<p>这么做，其实还有另外一个目的，就是准备把默认模板的宽度从760px（适应800*600的分辨率）改成960px（适应1024*768的分辨率）。</p>
<p>ps：五天之后，我做了<a href=" http://liumingquan.net/html/2009_06/wordpress-default-template-will-be-changed-to-960px-width.html" target="_blank">上述修改</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/so-that-the-article-appears-in-the-sidebar-on-page.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>将文章中的tag变成页面中的keywords</title>
		<link>http://liumingquan.net/html/2009_05/tag-to-the-article-in-the-keywords-into-a-page.html</link>
		<comments>http://liumingquan.net/html/2009_05/tag-to-the-article-in-the-keywords-into-a-page.html#comments</comments>
		<pubDate>Tue, 26 May 2009 03:07:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Tags 2 Meta Generator]]></category>
		<category><![CDATA[Tags To Meta Keywords]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/%e5%b0%86%e6%96%87%e7%ab%a0%e4%b8%ad%e7%9a%84tag%e5%8f%98%e6%88%90%e9%a1%b5%e9%9d%a2%e4%b8%ad%e7%9a%84keywords.html</guid>
		<description><![CDATA[一个优秀的html页面应当包括keywords和description。前者是网页内文章内容的关键词，后者是网页内文章内容的摘要，两者都是给搜索引擎用的，帮助搜索引擎更准确的判断网页的文章的内容。WordPress默认模板生成的页面中，没有keywords和description，这给搜索引擎带来了一点点困惑，同时，这样的html页面，称不上是优秀的html页面。
wordpress.org上有一些插件有这样的功能，就是可以把发表文章时候写的标签(tags)，自动转成keywords，出现在html页面中，同时把文章的标题，自动转成description，也出现在html页面中。经过搜索，找到了两个类似功能的插件。Tags 2 Meta Generator和Tags To Meta Keywords。后者我使用了一年多，插件稳定可靠，小巧简单。不过插件作者在2007年10月26日发布了Tags To Meta Keywords 0.31之后，就再也没有更新过了，当时WordPress的版本是2.3。 相比之下Tags 2 Meta Generator的最后一个版本0.1的发布时间2008年10月27日，不过值得一提的是，Tags 2 Meta Generator的最后版本，明确表示，支持的WordPress的版本是2.6.3。
所以，我决定使用Tags 2 Meta Generator。安装和启用的过程很简单，且没有需要设置的地方。之后，发表测试文章，果然，查看源文件之后，出现了keywords和description，并且正是取自于标签和文章标题。
感谢Tags 2 Meta Generator的作者制作出如此优秀之插件供人们使用。
到现在为止，]]></description>
			<content:encoded><![CDATA[<p>一个优秀的html页面应当包括keywords和description。前者是网页内文章内容的关键词，后者是网页内文章内容的摘要，两者都是给搜索引擎用的，帮助搜索引擎更准确的判断网页的文章的内容。WordPress默认模板生成的页面中，没有keywords和description，这给搜索引擎带来了一点点困惑，同时，这样的html页面，称不上是优秀的html页面。<span id="more-61"></span></p>
<p>wordpress.org上有一些插件有这样的功能，就是可以把发表文章时候写的标签(tags)，自动转成keywords，出现在html页面中，同时把文章的标题，自动转成description，也出现在html页面中。经过搜索，找到了两个类似功能的插件。<a href="http://wordpress.org/extend/plugins/tags-2-meta-generator/" target="_blank">Tags 2 Meta Generator</a>和<a href="http://www.thinkagain.cn/archives/827.html" target="_blank">Tags To Meta Keywords</a>。后者我使用了一年多，插件稳定可靠，小巧简单。不过插件作者在2007年10月26日发布了Tags To Meta Keywords 0.31之后，就再也没有更新过了，当时WordPress的版本是2.3。 相比之下Tags 2 Meta Generator的最后一个版本0.1的发布时间2008年10月27日，不过值得一提的是，Tags 2 Meta Generator的最后版本，明确表示，支持的WordPress的版本是2.6.3。</p>
<p>所以，我决定使用Tags 2 Meta Generator。安装和启用的过程很简单，且没有需要设置的地方。之后，发表测试文章，果然，查看源文件之后，出现了keywords和description，并且正是取自于标签和文章标题。</p>
<p>感谢Tags 2 Meta Generator的<a href="http://www.axdimensions.com/" target="_blank">作者</a>制作出如此优秀之插件供人们使用。</p>
<p>到现在为止，<a href="http://liumingquan.net/" target="_blank"">明泉</a>已经安装并使用了如下的插件:<a href="http://liumingquan.net/html/2009_05/clean-archives-reloaded.html" target="_blank">历史文章归档</a>，<a href="http://liumingquan.net/html/2009_05/cos-html-cache.html" target="_blank">页面静态化</a>，<a href="http://liumingquan.net/html/2009_05/cos_slug_translator.html" target="_blank">标题翻译成英文</a>和<a href="http://liumingquan.net/html/2009_05/disable-wordpress-auto-save-feature.html" target="_blank">禁用自动保存</a>，<a href="http://liumingquan.net/html/2009_05/best-wordpress-plug-ins-page.html" target="_blank">WordPress的最佳翻页插件</a>。你的博客都安装了哪些插件呢？</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/tag-to-the-article-in-the-keywords-into-a-page.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress最佳翻页插件</title>
		<link>http://liumingquan.net/html/2009_05/best-wordpress-plug-ins-page.html</link>
		<comments>http://liumingquan.net/html/2009_05/best-wordpress-plug-ins-page.html#comments</comments>
		<pubDate>Sun, 24 May 2009 02:06:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WP-PageNavi]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[翻页]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/wordpress%e6%9c%80%e4%bd%b3%e7%bf%bb%e9%a1%b5%e6%8f%92%e4%bb%b6.html</guid>
		<description><![CDATA[前边介绍了四个明泉已经安装的插件，分别是历史文章归档，页面静态化，标题翻译成英文和禁用自动保存，这次要说的是WordPress的最佳翻页插件WP-PageNavi。 WordPress自带了很简单的翻页功能，简单到了极致，只有“上一页”和“下一页”，随着文章的增多，这么简单的翻页功能显然不能满足访客的需要，于是，这款插件应运而生。
WP-PageNavi能够显示出来总共有多少页以及访客当前在第几页，当然也包括“上一页”和“下一页”，还有从1开始的，可以自定义数量的，到某个页面的链接。以上提及的这些文字，在插件的设置页面中都可以进行设置，也可以自定义css。据明泉观察，相当多的WordPress站点使用了这个插件。WP-PageNavi的作者Lester &#8216;GaMerZ&#8217; Chan也很勤奋，最后一次更新这个插件是2008年12月12日。
在Wp-PageNavi的设置页面，可以看到如下的变量：%CURRENT_PAGE%：当前页。如果在首页，这个数字会显示为1，如果向后翻了一页，这个数字就变成2。%TOTAL_PAGES%：  总共有多少个页面。这两个变量可以设置在“Text For Number Of Pages”里边，如果是中文的博客，写成“第 %CURRENT_PAGE% 页 总 %TOTAL_PAGES% 页”是个不错的选择。WP-PageNavi还有很多的设置，用文字叙述不如用图片说明，俗称，有图有真相。注意一下翻页功能的上下两条虚线，很插件本身没有关系，是其他的css造成的。(点小图看大图)
设置完成之后还不够，还需要把一段代码插入到希望显示出来翻页功能的位置，

1
&#60;?php if&#40;function_exists&#40;'wp_pagenavi'&#41;&#41; &#123; wp_pagenavi&#40;&#41;; &#125; ?&#62;

这样才算大功告成。
感谢插件作者Lester &#8216;GaMerZ&#8217; Chan写出如此之好的插件供我们使用。
]]></description>
			<content:encoded><![CDATA[<p>前边介绍了四个明泉已经安装的插件，分别是<a href="http://liumingquan.net/html/2009_05/clean-archives-reloaded.html" target="_blank">历史文章归档</a>，<a href="http://liumingquan.net/html/2009_05/cos-html-cache.html" target="_blank">页面静态化</a>，<a href="http://liumingquan.net/html/2009_05/cos_slug_translator.html" target="_blank">标题翻译成英文</a>和<a href="http://liumingquan.net/html/2009_05/disable-wordpress-auto-save-feature.html" target="_blank">禁用自动保存</a>，这次要说的是WordPress的最佳翻页插件<a href="http://lesterchan.net/wordpress/readme/wp-pagenavi.html" target="_blank">WP-PageNavi</a>。 WordPress自带了很简单的翻页功能，简单到了极致，只有“上一页”和“下一页”，随着文章的增多，这么简单的翻页功能显然不能满足访客的需要，于是，这款插件应运而生。<span id="more-48"></span></p>
<p>WP-PageNavi能够显示出来总共有多少页以及访客当前在第几页，当然也包括“上一页”和“下一页”，还有从1开始的，可以自定义数量的，到某个页面的链接。以上提及的这些文字，在插件的设置页面中都可以进行设置，也可以自定义css。据明泉观察，相当多的WordPress站点使用了这个插件。WP-PageNavi的作者Lester &#8216;GaMerZ&#8217; Chan也很勤奋，最后一次更新这个插件是2008年12月12日。</p>
<p>在Wp-PageNavi的设置页面，可以看到如下的变量：%CURRENT_PAGE%：当前页。如果在首页，这个数字会显示为1，如果向后翻了一页，这个数字就变成2。%TOTAL_PAGES%：  总共有多少个页面。这两个变量可以设置在“Text For Number Of Pages”里边，如果是中文的博客，写成“第 %CURRENT_PAGE% 页 总 %TOTAL_PAGES% 页”是个不错的选择。WP-PageNavi还有很多的设置，用文字叙述不如用图片说明，俗称，有图有真相。注意一下翻页功能的上下两条虚线，很插件本身没有关系，是其他的css造成的。(点小图看大图)</p>
<div id="attachment_47" class="wp-caption aligncenter" style="width: 310px"><a href="http://cid-c8ed248a10c0729b.skydrive.live.com/self.aspx/WordPress/2009/wp-pagenavi.png" target="_blank"><img class="size-medium wp-image-47" title="WP-PageNavi" src="http://0n5qzq.blu.livefilestore.com/y1pk7b0WSuI-9oT-gft0bIBC9w3uG0O9yJbUaqPrOAsMsp7ZwCPav_TNrItSDNMjbjDxzD3uEioFlPlK4nqrPHgHA/wp-pagenavi.png" alt="设置WP-PageNavi" width="300" height="139" /></a><p class="wp-caption-text">设置WP-PageNavi</p></div>
<p>设置完成之后还不够，还需要把一段代码插入到希望显示出来翻页功能的位置，</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:"",monospace;"><span style="color: #800000; font-weight: normal;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_pagenavi'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> wp_pagenavi<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #800000; font-weight: normal;">?&gt;</span></pre></td></tr></table></div>

<p>这样才算大功告成。</p>
<p>感谢插件作者Lester &#8216;GaMerZ&#8217; Chan写出如此之好的插件供我们使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/best-wordpress-plug-ins-page.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>禁用WordPress的自动保存功能</title>
		<link>http://liumingquan.net/html/2009_05/disable-wordpress-auto-save-feature.html</link>
		<comments>http://liumingquan.net/html/2009_05/disable-wordpress-auto-save-feature.html#comments</comments>
		<pubDate>Fri, 22 May 2009 07:22:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Disable autosave]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/%e7%a6%81%e7%94%a8wordpress%e7%9a%84%e8%87%aa%e5%8a%a8%e4%bf%9d%e5%ad%98%e5%8a%9f%e8%83%bd.html</guid>
		<description><![CDATA[嗯，我已经介绍了在这个博客程序上安装的三个插件，分别是历史文章归档，页面静态化和文章标题自动翻译成英文，今天说的这个插件是Disable autosave。这个插件的功能是禁用了WordPress的自动保存的功能。WordPress从2.6开始，增加了自动保存的功能，也就是在添加新文章的时候，程序会每隔一定的时间，自动将文本编辑窗口中的内容保存到数据库。这个功能有一定的争议，支持者认为这样可以有效降低浏览器故障导致窗口突然关闭而没有来得及保存文章这种情况带来的风险，而反对者认为这个功能使数据库中保存了很多无用的数据，会造成数据库冗余，查询缓慢。
反对者想出了一些办法来试图屏蔽掉自动保存的功能，例如，直接修改源代码，注释掉包含&#8221;autosave&#8221;的行，这样做有几点不好的地方，一是如果WordPress升级，这样做的效果就消失了，二是，在编辑文章的时候，浏览器左下角会报一个javascripts的错误。所以我没有使用这种方法，而是用了一个插件，Disable autosave。在安装并启用这个插件之后，插件就可以直接禁用掉WordPress的自动保存功能。
如果你也像我一样不喜欢WordPress的自动保存功能，也赶紧用一下Disable autosave吧！
]]></description>
			<content:encoded><![CDATA[<p>嗯，我已经介绍了在这个博客程序上安装的三个插件，分别是<a href="http://liumingquan.net/html/2009/05/clean-archives-reloaded.html" target="_blank">历史文章归档</a>，<a href="http://liumingquan.net/html/2009/05/cos-html-cache.html" target="_blank">页面静态化</a>和<a href="http://liumingquan.net/html/2009/05/cos_slug_translator.html" target="_blank">文章标题自动翻译成英文</a>，今天说的这个插件是Disable autosave。这个插件的功能是禁用了WordPress的自动保存的功能。WordPress从2.6开始，增加了自动保存的功能，也就是在添加新文章的时候，程序会每隔一定的时间，自动将文本编辑窗口中的内容保存到数据库。这个功能有一定的争议，支持者认为这样可以有效降低浏览器故障导致窗口突然关闭而没有来得及保存文章这种情况带来的风险，而反对者认为这个功能使数据库中保存了很多无用的数据，会造成数据库冗余，查询缓慢。<span id="more-42"></span></p>
<p>反对者想出了一些办法来试图屏蔽掉自动保存的功能，例如，直接修改源代码，注释掉包含&#8221;autosave&#8221;的行，这样做有几点不好的地方，一是如果WordPress升级，这样做的效果就消失了，二是，在编辑文章的时候，浏览器左下角会报一个javascripts的错误。所以我没有使用这种方法，而是用了一个插件，<a href="http://samm.dreamhosters.com/wordpress/plugins/" target="_blank">Disable autosave</a>。在安装并启用这个插件之后，插件就可以直接禁用掉WordPress的自动保存功能。</p>
<p>如果你也像我一样不喜欢WordPress的自动保存功能，也赶紧用一下Disable autosave吧！</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/disable-wordpress-auto-save-feature.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress标题自动翻译英文插件</title>
		<link>http://liumingquan.net/html/2009_05/cos_slug_translator.html</link>
		<comments>http://liumingquan.net/html/2009_05/cos_slug_translator.html#comments</comments>
		<pubDate>Wed, 20 May 2009 13:10:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[cos_slug_translator]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/cos_slug_translator.html</guid>
		<description><![CDATA[在安装了历史文章归档和页面静态化插件之后，又安装了文章标题自动翻译成英文的插件，cos_slug_translator。cos_slug_translator和cos-html-cache.html的作者是同一个人。
使用插件的前提条件是WordPress的固定链接设置是“自定义结构”，并且设置成必须要包含“%postname%”。之后安装并启用插件。则以后发文章的时候，插件会调用Google 翻译，把中文的标题翻译成英文，并用“-”隔开每个单词，这样的好处是有利于SEO。
感谢插件的作者写出这么优秀的插件供别人使用。
]]></description>
			<content:encoded><![CDATA[<p>在安装了<a href="http://liumingquan.net/html/2009/05/clean-archives-reloaded.html" target="_blank">历史文章归档</a>和<a href="http://liumingquan.net/html/2009/05/cos-html-cache.html" target="_blank">页面静态化</a>插件之后，又安装了文章标题自动翻译成英文的插件，cos_slug_translator。<a href="http://www.storyday.com/html/y2007/1202_auto-slug-translate-plugin.html" target="_blank">cos_slug_translator</a>和cos-html-cache.html的作者是同一个人。<span id="more-40"></span></p>
<p>使用插件的前提条件是WordPress的固定链接设置是“自定义结构”，并且设置成必须要包含“%postname%”。之后安装并启用插件。则以后发文章的时候，插件会调用Google 翻译，把中文的标题翻译成英文，并用“-”隔开每个单词，这样的好处是有利于SEO。</p>
<p>感谢插件的作者写出这么优秀的插件供别人使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/cos_slug_translator.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress页面静态化插件</title>
		<link>http://liumingquan.net/html/2009_05/cos-html-cache.html</link>
		<comments>http://liumingquan.net/html/2009_05/cos-html-cache.html#comments</comments>
		<pubDate>Mon, 18 May 2009 05:30:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[cos-html-cache]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/cos-html-cache.html</guid>
		<description><![CDATA[相对于刚刚安装好的Clean Archives Reloaded, cos-html-cache则是装好WordPress后第一个安装的插件。cos-html-cache的作用是页面静态化。cos-html-cache能够生成文章和首页HTML缓存文件，当有评论、修改、添加和删除文章的时候更新首页和当前页面缓存。在http://wordpress.org/extend/plugins/cos-html-cache/ 可以下载到cos-html-cache的最新的版本，当然，插件作者的网站，也可以找到插件的安装及使用方法。目前此插件的最新版本是2.7.3
其实在去年，我已经知道并开始使用cos-html-cache，这个插件安装和配置的难度会大于Clean Archives Reloaded，最大的问题是，所有操作都按照插件作者在文档中描述的进行，每个步骤都是正确的，但得不到正确的结果，就是无法生成静态页面。碰到这种情况，恐怕只能换其他类似的插件了。我曾经有一个Blog百般测试之后，还无法使用cos-html-cache，无奈只能换成了另外一个类似功能的插件：WP-Super-Cache。
在国外的一些虚拟主机上，PHP中的函数$_SERVER取得的值，比较神秘，这种情况下，cos-html-cache生成的静态页面，不会保存在你指定的目录下，有可能会保存在空间的根目录下。插件作者对于这种情况给出了一个解决方案。修改cos-html-cache.php文件 将$path = $_SERVER['DOCUMENT_ROOT'].”/”;替换为$path = ABSPATH ; 如果目录依然错乱，继续修改 $path = ABSPATH.”/youblogdir”,直到正常为止。我和我的朋友都碰到过这个问题，修改之后得以解决。
页面静态化以后，对服务器和数据库的压力将会减少。相对于从数据库中读出并显示出来，浏览者会感觉到页面完全加载的时间很变短，同时服务器资源超标的可能性也会降低。很感谢作者能写出如此优秀的WordPress插件。
]]></description>
			<content:encoded><![CDATA[<p>相对于刚刚安装好的<a href="http://liumingquan.net/html/2009_05/clean-archives-reloaded.html" target="_blank">Clean Archives Reloaded</a>, cos-html-cache则是装好WordPress后第一个安装的插件。cos-html-cache的作用是页面静态化。cos-html-cache能够生成文章和首页HTML缓存文件，当有评论、修改、添加和删除文章的时候更新首页和当前页面缓存。在<a href="http://wordpress.org/extend/plugins/cos-html-cache/" target="_blank">http://wordpress.org/extend/plugins/cos-html-cache/</a> 可以下载到cos-html-cache的最新的版本，当然，<a href="http://www.storyday.com/" target="_blank">插件作者的网站</a>，也可以找到插件的安装及使用方法。目前此插件的最新版本是2.7.3<span id="more-27"></span></p>
<p>其实在去年，我已经知道并开始使用cos-html-cache，这个插件安装和配置的难度会大于<a href="http://liumingquan.net/html/2009_05/clean-archives-reloaded.html" target="_blank">Clean Archives Reloaded</a>，最大的问题是，所有操作都按照插件作者在文档中描述的进行，每个步骤都是正确的，但得不到正确的结果，就是无法生成静态页面。碰到这种情况，恐怕只能换其他类似的插件了。我曾经有一个Blog百般测试之后，还无法使用cos-html-cache，无奈只能换成了另外一个类似功能的插件：<a href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank">WP-Super-Cache</a>。</p>
<p>在国外的一些虚拟主机上，PHP中的函数$_SERVER取得的值，比较神秘，这种情况下，cos-html-cache生成的静态页面，不会保存在你指定的目录下，有可能会保存在空间的根目录下。插件作者对于这种情况给出了一个解决方案。修改cos-html-cache.php文件 将$path = $_SERVER['DOCUMENT_ROOT'].”/”;替换为$path = ABSPATH ; 如果目录依然错乱，继续修改 $path = ABSPATH.”/youblogdir”,直到正常为止。我和我的朋友都碰到过这个问题，修改之后得以解决。</p>
<p>页面静态化以后，对服务器和数据库的压力将会减少。相对于从数据库中读出并显示出来，浏览者会感觉到页面完全加载的时间很变短，同时服务器资源超标的可能性也会降低。很感谢作者能写出如此优秀的WordPress插件。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/cos-html-cache.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress历史文档归档插件</title>
		<link>http://liumingquan.net/html/2009_05/clean-archives-reloaded.html</link>
		<comments>http://liumingquan.net/html/2009_05/clean-archives-reloaded.html#comments</comments>
		<pubDate>Fri, 15 May 2009 04:29:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Clean Archives Reloaded]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://liumingquan.net/html/2009/05/clean-archives-reloaded.html</guid>
		<description><![CDATA[今天启用了Clean Archives Reloaded插件，这是一个把历史文章归档，并将其链接显示在一个页面内的插件。Clean Archives Reloaded在Wordpress.org上的页面是：http://wordpress.org/extend/plugins/clean-archives-reloaded/ 插件作者的网站在：http://www.viper007bond.com/ Clean Archives Reloaded的最新版本是3.1.8

Clean Archives Reloaded的安装和设置不是很困难。FTP上传到/wp-content/plugins目录后，在后台启用插件，之后新建一个页面，页面中的内容可以填两项: &#8220;{cartotalposts}“ 和 ”{cleanarchivesreloaded}“(注意要把大括号改成中括号)。 前者显示出来博客内的文章数量，后者显示出来一个利用javascripts生成的可折叠的文章链接列表。
使用插件之后的具体效果，可以参见 http://liumingquan.net/archive
感谢插件的作者，写出这么优秀的插件供别人使用。
]]></description>
			<content:encoded><![CDATA[<p>今天启用了Clean Archives Reloaded插件，这是一个把历史文章归档，并将其链接显示在一个页面内的插件。Clean Archives Reloaded在Wordpress.org上的页面是：<a href="http://wordpress.org/extend/plugins/clean-archives-reloaded/" target="_blank">http://wordpress.org/extend/plugins/clean-archives-reloaded/</a> 插件作者的网站在：<a href="http://www.viper007bond.com/" target="_blank">http://www.viper007bond.com/</a> Clean Archives Reloaded的最新版本是3.1.8<br />
<span id="more-24"></span><br />
Clean Archives Reloaded的安装和设置不是很困难。FTP上传到/wp-content/plugins目录后，在后台启用插件，之后新建一个页面，页面中的内容可以填两项: &#8220;{cartotalposts}“ 和 ”{cleanarchivesreloaded}“(注意要把大括号改成中括号)。 前者显示出来博客内的文章数量，后者显示出来一个利用javascripts生成的可折叠的文章链接列表。</p>
<p>使用插件之后的具体效果，可以参见 <a href="http://liumingquan.net/archive" target="_blank">http://liumingquan.net/archive</a></p>
<p>感谢插件的作者，写出这么优秀的插件供别人使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://liumingquan.net/html/2009_05/clean-archives-reloaded.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
