<?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>FVF.me&#039;Ye &#187; Wordpress</title>
	<atom:link href="http://fvf.me/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://fvf.me</link>
	<description>我是孤独的根号5</description>
	<lastBuildDate>Mon, 19 Sep 2011 12:10:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>wp_tag_cloud()</title>
		<link>http://fvf.me/wordpress/theme/wp_tag_cloud.html</link>
		<comments>http://fvf.me/wordpress/theme/wp_tag_cloud.html#comments</comments>
		<pubDate>Sat, 26 Mar 2011 11:13:00 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[标签云]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/wp_tag_cloud.html</guid>
		<description><![CDATA[函数说明 该函数用来显示一列标签，即所谓的标签云。 wp_tag_cloud()的多种参数需要使用&#38;连接，放在单引号 (')中以字符串方式传递。 用法： &#60;?php wp_tag_cloud(smallest=8&#38;largest=22&#38;unit=pt&#38;number=45&#38;format=flat&#38;orderby=&#38;nameorder =ASC&#38;exclude=1,2&#38;include=3,5') ?&#62; smallest=整数值 (整数) 使用最少的标签的字号 (单位由unit参数给出). largest=整数值 (整数) 使用最多的标签的字号 (单位由unit参数给出). unit=pt（默认）, px, em, % 标签字号的单位。 他可以是任何CSS长度单位 number= 云图显示标签的个数。 (使用&#34;0&#34;将显示所有标签。) format=flat（默认标签用空格分隔），list（无序列表）array（保存在数值中） 云图显示的格式。 orderby=name（默认，名称），count（使用次数） 标签的排序 order=ASC（默认值，升序），DESC（降序） 排序次序。有效值 – 必须大写： exclude=整数值 排除用逗号（半角）分隔的一列标签（term_id） include=整数值 包含用逗号（半角）分隔的一列标签]]></description>
			<content:encoded><![CDATA[<p>函数说明 </p>
<p>该函数用来显示一列标签，即所谓的标签云。    <br />wp_tag_cloud()的多种参数需要使用&amp;连接，放在单引号 (')中以字符串方式传递。</p>
<p>用法： </p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="background-color: rgb(15,20,15); font-style: italic; color: rgb(255,0,7); font-weight: bold">&lt;?php</span> <span style="color: rgb(255,255,255)">wp_tag_cloud</span>(<span style="color: rgb(255,255,255)">smallest</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(0,134,247); font-weight: bold">8</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(255,255,255)">largest</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(0,134,247); font-weight: bold">22</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(255,255,255)">unit</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(255,255,255)">pt</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(255,255,255)">number</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(0,134,247); font-weight: bold">45</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(255,255,255)">format</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(255,255,255)">flat</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(255,255,255)">orderby</span><span style="color: rgb(255,255,255)">=&amp;</span><span style="color: rgb(255,255,255)">nameorder</span> <span style="color: rgb(255,255,255)">=</span><span style="color: rgb(255,255,255)">ASC</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(255,255,255)">exclude</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(0,134,247); font-weight: bold">1</span><span style="color: rgb(255,255,255)">,</span><span style="color: rgb(0,134,247); font-weight: bold">2</span><span style="color: rgb(255,255,255)">&amp;</span><span style="color: rgb(251,102,10); font-weight: bold">include</span><span style="color: rgb(255,255,255)">=</span><span style="color: rgb(0,134,247); font-weight: bold">3</span><span style="color: rgb(255,255,255)">,</span><span style="color: rgb(0,134,247); font-weight: bold">5</span><span style="color: rgb(255,255,255)">'</span>) <span style="background-color: rgb(15,20,15); font-style: italic; color: rgb(255,0,7); font-weight: bold">?&gt;</span>     </div>
<ul>
<li>smallest=整数值 </li>
<li>(整数) 使用最少的标签的字号 (单位由unit参数给出). </li>
<li>largest=整数值 </li>
<li>(整数) 使用最多的标签的字号 (单位由unit参数给出). <strike></strike></li>
<li>unit=pt（默认）, px, em, % </li>
<li>标签字号的单位。 他可以是任何CSS长度单位 </li>
<li>number= </li>
<li>云图显示标签的个数。 (使用&quot;0&quot;将显示所有标签。) </li>
<li>format=flat（默认标签用空格分隔），list（无序列表）array（保存在数值中） </li>
<li>云图显示的格式。 </li>
<li>orderby=name（默认，名称），count（使用次数） </li>
<li>标签的排序 </li>
<li>order=ASC（默认值，升序），DESC（降序） </li>
<li>排序次序。有效值 – 必须大写： </li>
<li>exclude=整数值 </li>
<li>排除用逗号（半角）分隔的一列标签（term_id） </li>
<li>include=整数值 </li>
<li>包含用逗号（半角）分隔的一列标签 </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/wp_tag_cloud.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wp_list_categories()</title>
		<link>http://fvf.me/wordpress/theme/wp_list_categories.html</link>
		<comments>http://fvf.me/wordpress/theme/wp_list_categories.html#comments</comments>
		<pubDate>Fri, 25 Mar 2011 11:04:00 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[分类]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/wp_list_categories.html</guid>
		<description><![CDATA[函数说明 该函数用来获取博客文章的分类信 息，并可以通过设置适当的函数参数，将其显示出来。wp_list_categories()的多种参数需要使用&#38;连接，放在单引号 (')中以字符串方式传递。 用法： &#60;?php wp_list_categories('orderby=name&#38;order=ASC&#38; show_count=1&#38;use_desc_for_title=1&#38;feed=任意值&#38;exclude=1,3&#38; number=10')?&#62; orderby=ID、name（默认值）、count 作用是按这3个值来排序。 order=ASC（默认值）或DESC ASC为升序，DESC为降序。 show_last_updated=0（默认值）或1 0无作用，1为最近更新的分类显示在前面。 style=list（默认值）、none list的作用改变当前正在浏览的分类名字的样式，给输出的html代码&#60;li&#62;中加一个class=&#34;current-cat&#34; show_count=0或1（默认值） 1在每个分类名称后面显示属于该分类的文章数，0不显示。 show_option_all=任意值 更改标题为任意值，一般利用此参数加个“首页”。 hide_empty=0或1（默认值） 1是隐藏没有发表日志的分类，0是显示所有。 use_desc_for_title=0或1（默认值） 0为关闭说明，1为显示说明，就是为每个分类名称超链接添加一个title属性，鼠标移动到连接上就显示你在后台填的分类说明。 child_of=整数值 显示指定ID（所填的这个整数）下的子分类。 feed=任意值 在每个分类信息旁边添加一个名为“任意值”的超链接，提供该分类的RSS订阅 feed_image=图片的地址 用来在分类后面显示个RSS Feed图标 exclude=填分类名称或者分类ID 隐藏某个分类在列表中的出现。 include=填分类名称或者分类ID 只显示所填的这个分类名或ID。 title_li=任意值 用来改变列表标题的为任意值。 number=整数值 设置一个显示上限。 尽管参数有点多，显得有点复杂，但其实只需注意经常用到的orderby,order,show_count以及number等四个参量就好了。]]></description>
			<content:encoded><![CDATA[<p>函数说明</p>
<p>该函数用来获取博客文章的分类信 息，并可以通过设置适当的函数参数，将其显示出来。wp_list_categories()的多种参数需要使用&amp;连接，放在单引号 (')中以字符串方式传递。</p>
<p>用法： </p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="background-color: rgb(15,20,15); font-style: italic; color: rgb(255,0,7); font-weight: bold">&lt;?php</span> <span style="color: rgb(255,255,255)">wp_list_categories</span>(<span style="color: rgb(0,134,210)">'orderby=name&amp;order=ASC&amp; show_count=1&amp;use_desc_for_title=1&amp;feed=任意值&amp;exclude=1,3&amp; number=10'</span>)<span style="background-color: rgb(15,20,15); font-style: italic; color: rgb(255,0,7); font-weight: bold">?&gt;</span>     </div>
<ul>
<li>orderby=ID、name（默认值）、count      <br />作用是按这3个值来排序。 </li>
<li>order=ASC（默认值）或DESC      <br />ASC为升序，DESC为降序。 </li>
<li>show_last_updated=0（默认值）或1      <br />0无作用，1为最近更新的分类显示在前面。 </li>
<li>style=list（默认值）、none      <br />list的作用改变当前正在浏览的分类名字的样式，给输出的html代码&lt;li&gt;中加一个class=&quot;current-cat&quot; </li>
<li>show_count=0或1（默认值）      <br />1在每个分类名称后面显示属于该分类的文章数，0不显示。 </li>
<li>show_option_all=任意值      <br />更改标题为任意值，一般利用此参数加个“首页”。 </li>
<li>hide_empty=0或1（默认值）      <br />1是隐藏没有发表日志的分类，0是显示所有。 </li>
<li>use_desc_for_title=0或1（默认值）      <br />0为关闭说明，1为显示说明，就是为每个分类名称超链接添加一个title属性，鼠标移动到连接上就显示你在后台填的分类说明。 </li>
<li>child_of=整数值     <br />显示指定ID（所填的这个整数）下的子分类。 </li>
<li>feed=任意值     <br />在每个分类信息旁边添加一个名为“任意值”的超链接，提供该分类的RSS订阅 </li>
<li>feed_image=图片的地址      <br />用来在分类后面显示个RSS Feed图标 </li>
<li>exclude=填分类名称或者分类ID      <br />隐藏某个分类在列表中的出现。 </li>
<li>include=填分类名称或者分类ID      <br />只显示所填的这个分类名或ID。 </li>
<li>title_li=任意值     <br />用来改变列表标题的为任意值。 </li>
<li>number=整数值     <br />设置一个显示上限。 </li>
<p> 尽管参数有点多，显得有点复杂，但其实只需注意经常用到的orderby,order,show_count以及number等四个参量就好了。</ul>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/wp_list_categories.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wp_get_archives()</title>
		<link>http://fvf.me/wordpress/theme/wp_get_archives.html</link>
		<comments>http://fvf.me/wordpress/theme/wp_get_archives.html#comments</comments>
		<pubDate>Thu, 24 Mar 2011 13:11:39 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[archives]]></category>
		<category><![CDATA[存档]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/wp_get_archives.html</guid>
		<description><![CDATA[函数说明 该函数用来获取博客的文章存档，通过设置函数的参数，可以按各种方式获取，如按月，按年等等。 wp_get_archives()函数后面可以跟多种参数，只不过所有参数都需要使用&#38;连接，并放在单引号(')中以字符串方式传递给函数 用法： &#60;?php wp_get_archives('type=monthly&#38;limit=12&#38;format=html&#38;before=before&#38;after=after&#38;show_post_count=true'); ?&#62; type=排列方式 按月 type=monthly ;按日 type=daily; 按周 type=weekly; 文章 type=postbypost （显示文字标题） limit=显示数量 如 limit=12 就是显示数量是12 format=输出格式&#160; 默认就是 html使用通常的HTML中&#60;li&#62;格式化文章列表 format=html&#160;&#160; 输出列表格式 &#60;li&#62;$before&#60;a href='$url' title='$title_tex'&#62;$text&#60;/a&#62;$after&#60;/li&#62; format=link&#160; 输出链接格式 &#60;link rel=archives' title='$title_text' href='$url' /&#62; format=option&#160; 自定义定义下拉列表格式 &#60;option value='$url'&#62;$before $text $after&#60;/option&#62; format=custom&#160;&#160; 输出之定义格式 &#60;a href='$url' title='$title_text'&#62;$text&#60;/a&#62;$after before=要加在函数前面的文字 after=要加在函数后面的文字 show_post_count=是否显示文章数量 预设为不显示false ，显示为true，该参量是个bool值 尽管参数有点多，显得有点复杂，但其实只需注意经常用到的type、show_post_count以及limit等三个参量就好了。]]></description>
			<content:encoded><![CDATA[<p>函数说明
<p>该函数用来获取博客的文章存档，通过设置函数的参数，可以按各种方式获取，如按月，按年等等。 wp_get_archives()函数后面可以跟多种参数，只不过所有参数都需要使用&amp;连接，并放在单引号(')中以字符串方式传递给函数 </p>
<p> 用法：
<div style="background-color: rgb(30,30,39); font-family: tahoma, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="background-color: rgb(15,20,15); font-style: italic; color: rgb(255,0,7); font-weight: bold">&lt;?php</span> <span style="color: rgb(255,255,255)">wp_get_archives</span>(<span style="color: rgb(0,134,210)">'type=monthly&amp;limit=12&amp;format=html&amp;before=before&amp;after=after&amp;show_post_count=true'</span>); <span style="background-color: rgb(15,20,15); font-style: italic; color: rgb(255,0,7); font-weight: bold">?&gt;</span>     </div>
<p>type=排列方式    <br />按月 type=monthly ;按日 type=daily; 按周 type=weekly; 文章 type=postbypost （显示文字标题） </p>
<p>limit=显示数量 如 limit=12 就是显示数量是12 </p>
<p>format=输出格式&#160; 默认就是 html使用通常的HTML中&lt;li&gt;格式化文章列表 </p>
<p>format=html&#160;&#160; 输出列表格式 </p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="color: rgb(251,102,10); font-weight: bold">&lt;li&gt;</span><span style="color: rgb(255,255,255)">$before</span><span style="color: rgb(251,102,10); font-weight: bold">&lt;a</span> <span style="color: rgb(255,0,134); font-weight: bold">href=</span><span style="color: rgb(0,134,210)">'$url'</span> <span style="color: rgb(255,0,134); font-weight: bold">title=</span><span style="color: rgb(0,134,210)">'$title_tex'</span><span style="color: rgb(251,102,10); font-weight: bold">&gt;</span><span style="color: rgb(255,255,255)">$text</span><span style="color: rgb(251,102,10); font-weight: bold">&lt;/a&gt;</span><span style="color: rgb(255,255,255)">$after</span><span style="color: rgb(251,102,10); font-weight: bold">&lt;/li&gt;</span>     </div>
<p>format=link&#160; 输出链接格式 </p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;,&#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="color: rgb(251,102,10); font-weight: bold">&lt;link</span> <span style="color: rgb(255,0,134); font-weight: bold">rel=</span><span style="color: rgb(0,134,210)">archives'</span> <span style="color: rgb(255,0,134); font-weight: bold">title=</span><span style="color: rgb(0,134,210)">'$title_text'</span> <span style="color: rgb(255,0,134); font-weight: bold">href=</span><span style="color: rgb(0,134,210)">'$url'</span> <span style="color: rgb(251,102,10); font-weight: bold">/&gt;</span>     </div>
<p>format=option&#160; 自定义定义下拉列表格式 </p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="color: rgb(251,102,10); font-weight: bold">&lt;option</span> <span style="color: rgb(255,0,134); font-weight: bold">value=</span><span style="color: rgb(0,134,210)">'$url'</span><span style="color: rgb(251,102,10); font-weight: bold">&gt;</span><span style="color: rgb(255,255,255)">$before $text $after</span><span style="color: rgb(251,102,10); font-weight: bold">&lt;/option&gt;</span>     </div>
<p>format=custom&#160;&#160; 输出之定义格式 </p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(255,255,255)" class="source"><span style="color: rgb(251,102,10); font-weight: bold">&lt;a</span> <span style="color: rgb(255,0,134); font-weight: bold">href=</span><span style="color: rgb(0,134,210)">'$url'</span> <span style="color: rgb(255,0,134); font-weight: bold">title=</span><span style="color: rgb(0,134,210)">'$title_text'</span><span style="color: rgb(251,102,10); font-weight: bold">&gt;</span><span style="color: rgb(255,255,255)">$text</span><span style="color: rgb(251,102,10); font-weight: bold">&lt;/a&gt;</span><span style="color: rgb(255,255,255)">$after</span></div>
<p>before=要加在函数前面的文字 </p>
<p>after=要加在函数后面的文字 </p>
</p>
<p>show_post_count=是否显示文章数量 预设为不显示false ，显示为true，该参量是个bool值 </p>
<p>尽管参数有点多，显得有点复杂，但其实只需注意经常用到的type、show_post_count以及limit等三个参量就好了。</p>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/wp_get_archives.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>彩色标签云</title>
		<link>http://fvf.me/wordpress/theme/color-tag-cloud.html</link>
		<comments>http://fvf.me/wordpress/theme/color-tag-cloud.html#comments</comments>
		<pubDate>Thu, 24 Mar 2011 09:52:23 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[彩色]]></category>
		<category><![CDATA[标签云]]></category>

		<guid isPermaLink="false">http://fvf.me/diary/%e5%bd%a9%e8%89%b2%e6%a0%87%e7%ad%be%e4%ba%91.html</guid>
		<description><![CDATA[实现彩色标签云，颜色随即显示在主题function.php文件中添加下文： &#60;?php function colorCloud($text) { $text = preg_replace_callback('&#124;&#60;a (.+?)&#62;&#124;i', 'colorCloudCallback', $text); return $text; } function colorCloudCallback($matches) { $text = $matches[1]; $color = dechex(rand(0,16777215)); //修改颜色随即范围 $pattern = '/style=(\'&#124;\&#34;)(.*)(\'&#124;\&#34;)/i'; $text = preg_replace($pattern, &#34;style=\&#34;color:#{$color};$2;\&#34;&#34;, $text); return &#34;&#60;a $text&#62;&#34;; } add_filter('wp_tag_cloud', 'colorCloud', 1); ?&#62; 在主题中使用添加以下调用，标签中，最小字体大小为8，最大字字体大小为20，最多显示50个标签。 &#60;?php wp_tag_cloud('smallest=8&#38;largest=20&#38;number=50'); ?&#62;]]></description>
			<content:encoded><![CDATA[<p>实现彩色标签云，颜色随即显示在主题function.php文件中添加下文：</p>
<div style="background-color: rgb(30,30,39); font-family: &#39;Microsoft Yahei&#39;, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(208,208,208)" class="source"><span style="color: rgb(205,40,40); font-weight: bold">&lt;?php</span>     <br /><span style="color: rgb(106,184,37); font-weight: bold">function</span> <span style="color: rgb(68,127,207)">colorCloud</span>(<span style="color: rgb(64,255,255)">$text</span>) <span style="color: rgb(208,208,208)">{</span>     <br /><span style="color: rgb(64,255,255)">$text</span> <span style="color: rgb(208,208,208)">=</span> <span style="color: rgb(36,144,157)">preg_replace_callback</span>(<span style="color: rgb(237,157,19)">'|&lt;a (.+?)&gt;|i'</span><span style="color: rgb(208,208,208)">,</span> <span style="color: rgb(237,157,19)">'colorCloudCallback'</span><span style="color: rgb(208,208,208)">,</span> <span style="color: rgb(64,255,255)">$text</span>);     <br /><span style="color: rgb(106,184,37); font-weight: bold">return</span> <span style="color: rgb(64,255,255)">$text</span>;     <br /><span style="color: rgb(208,208,208)">}</span>     <br /><span style="color: rgb(106,184,37); font-weight: bold">function</span> <span style="color: rgb(68,127,207)">colorCloudCallback</span>(<span style="color: rgb(64,255,255)">$matches</span>) <span style="color: rgb(208,208,208)">{</span>     <br /><span style="color: rgb(64,255,255)">$text</span> <span style="color: rgb(208,208,208)">=</span> <span style="color: rgb(64,255,255)">$matches</span><span style="color: rgb(208,208,208)">[</span><span style="color: rgb(54,119,169)">1</span><span style="color: rgb(208,208,208)">];</span>     <br /><span style="color: rgb(64,255,255)">$color</span> <span style="color: rgb(208,208,208)">=</span> <span style="color: rgb(36,144,157)">dechex</span>(<span style="color: rgb(36,144,157)">rand</span>(<span style="color: rgb(54,119,169)">0</span><span style="color: rgb(208,208,208)">,</span><span style="color: rgb(54,119,169)">16777215</span>)); <span color:="color:" rgb(153,153,153)?="rgb(153,153,153)?">//修改颜色随即范围</span>     <br /><span style="color: rgb(64,255,255)">$pattern</span> <span style="color: rgb(208,208,208)">=</span> <span style="color: rgb(237,157,19)">'/style=(\'|\&quot;)(.*)(\'|\&quot;)/i'</span>;     <br /><span style="color: rgb(64,255,255)">$text</span> <span style="color: rgb(208,208,208)">=</span> <span style="color: rgb(36,144,157)">preg_replace</span>(<span style="color: rgb(64,255,255)">$pattern</span><span style="color: rgb(208,208,208)">,</span> <span style="color: rgb(237,157,19)">&quot;style=</span><span style="color: rgb(237,157,19)">\&quot;</span><span style="color: rgb(237,157,19)">color:#</span><span style="color: rgb(237,157,19)">{</span><span style="color: rgb(64,255,255)">$color</span><span style="color: rgb(237,157,19)">}</span><span style="color: rgb(237,157,19)">;$2;</span><span style="color: rgb(237,157,19)">\&quot;</span><span style="color: rgb(237,157,19)">&quot;</span><span style="color: rgb(208,208,208)">,</span> <span style="color: rgb(64,255,255)">$text</span>);     <br /><span style="color: rgb(106,184,37); font-weight: bold">return</span> <span style="color: rgb(237,157,19)">&quot;&lt;a </span><span style="color: rgb(237,157,19)">$text</span><span style="color: rgb(237,157,19)">&gt;&quot;</span>;     <br /><span style="color: rgb(208,208,208)">}</span>     <br /><span style="color: rgb(208,208,208)">add_filter</span>(<span style="color: rgb(237,157,19)">'wp_tag_cloud'</span><span style="color: rgb(208,208,208)">,</span> <span style="color: rgb(237,157,19)">'colorCloud'</span><span style="color: rgb(208,208,208)">,</span> <span style="color: rgb(54,119,169)">1</span>);     <br /><span style="color: rgb(205,40,40); font-weight: bold">?&gt;</span></div>
<p>在主题中使用添加以下调用，标签中，最小字体大小为8，最大字字体大小为20，最多显示50个标签。</p>
<div style="background-color: rgb(0,0,0); font-family: tahoma, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(192,192,192)" class="source"><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(192,192,192)">wp_tag_cloud</span>(<span style="color: rgb(187,187,0)">'smallest=8&amp;largest=20&amp;number=50'</span>); <span style="color: rgb(255,255,255)">?&gt;</span>     </div>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/color-tag-cloud.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>description和keywords优化之wordpress</title>
		<link>http://fvf.me/wordpress/optimization-of-the-description-and-the-keywords-wordpress.html</link>
		<comments>http://fvf.me/wordpress/optimization-of-the-description-and-the-keywords-wordpress.html#comments</comments>
		<pubDate>Sat, 04 Sep 2010 04:21:00 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[description]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/description%e5%92%8ckeywords%e4%bc%98%e5%8c%96%e4%b9%8bwordpress.html</guid>
		<description><![CDATA[设置主题的description（描述）和keywords（关键词）优化代码]]></description>
			<content:encoded><![CDATA[<p><strong>Keywords：</strong>为搜索引擎提供参考，网页内容所包含的核心搜索关键词。</p>
<p><strong>Description：</strong>为搜索引擎提供参考，网页的描述信息;搜索引擎采纳后，作为搜索结果中的页面摘要(snippet)显示。</p>
<p>首先打开header.php，开始修改主题的description（描述）和keywords（关键词），在&lt;/head&gt;标签之前加入代码</p>
<div style="background-color: rgb(0,0,0); font-family: tahoma, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(192,192,192)" class="source"><span style="color: rgb(255,255,255)">&lt;?php</span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">if</span> (<span style="color: rgb(192,192,192)">is_home</span><span style="color: rgb(192,192,192)">()){</span>    <br /><span style="color: rgb(204,204,0)">$description</span> <span style="color: rgb(192,192,192)">=</span><span style="color: rgb(187,187,0)">&quot;你主页的描述&quot;</span>;    <br /><span style="color: rgb(204,204,0)">$keywords</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(187,187,0)">&quot;你主页的关键词&quot;</span>;    <br /><span style="color: rgb(192,192,192)">}</span> <span style="color: rgb(255,255,0); font-weight: bold">elseif</span> (<span style="color: rgb(192,192,192)">is_single</span><span style="color: rgb(192,192,192)">()){</span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">if</span> (<span style="color: rgb(204,204,0)">$post</span><span style="color: rgb(192,192,192)">-&gt;</span><span style="color: rgb(255,255,0)">post_excerpt</span>) <span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(204,204,0)">$description</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(204,204,0)">$post</span><span style="color: rgb(192,192,192)">-&gt;</span><span style="color: rgb(255,255,0)">post_excerpt</span>;<span style="color: rgb(105,105,105)">//显示摘要</span>    <br /><span style="color: rgb(192,192,192)">}</span> <span style="color: rgb(255,255,0); font-weight: bold">else</span> <span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(204,204,0)">$description</span> <span style="color: rgb(192,192,192)">=</span><span style="color: rgb(192,192,192)">mb_substr</span>(<span style="color: rgb(192,192,192)">strip_tags</span>(<span style="color: rgb(204,204,0)">$post</span><span style="color: rgb(192,192,192)">-&gt;</span><span style="color: rgb(255,255,0)">post_content</span><span style="color: rgb(192,192,192)">),</span><span style="color: rgb(192,192,192)">0</span><span style="color: rgb(192,192,192)">,</span><span style="color: rgb(192,192,192)">210</span>);<span style="color: rgb(105,105,105)">//截取正文210个字</span>    <br /><span style="color: rgb(192,192,192)">}</span>    <br /><span style="color: rgb(204,204,0)">$keywords</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(187,187,0)">&quot;&quot;</span>;    <br /><span style="color: rgb(204,204,0)">$tags</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(192,192,192)">wp_get_post_tags</span>(<span style="color: rgb(204,204,0)">$post</span><span style="color: rgb(192,192,192)">-&gt;</span><span style="color: rgb(255,255,0)">ID</span>);    <br /><span style="color: rgb(255,255,0); font-weight: bold">foreach</span> (<span style="color: rgb(204,204,0)">$tags</span> <span style="color: rgb(255,255,0); font-weight: bold">as</span> <span style="color: rgb(204,204,0)">$tag</span> ) <span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(204,204,0)">$keywords</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(204,204,0)">$keywords</span> <span style="color: rgb(192,192,192)">.</span> <span style="color: rgb(204,204,0)">$tag</span><span style="color: rgb(192,192,192)">-&gt;</span><span style="color: rgb(255,255,0)">name</span> <span style="color: rgb(192,192,192)">.</span> <span style="color: rgb(187,187,0)">&quot;, &quot;</span>;<span style="color: rgb(105,105,105)">//显示标签</span>    <br /><span style="color: rgb(192,192,192)">}</span>    <br /><span style="color: rgb(192,192,192)">}</span> <span style="color: rgb(255,255,0); font-weight: bold">elseif</span>(<span style="color: rgb(192,192,192)">is_category</span><span style="color: rgb(192,192,192)">()){</span>    <br /><span style="color: rgb(204,204,0)">$description</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(192,192,192)">category_description</span>();<span style="color: rgb(105,105,105)">//当前分类目录所填写的说明信息</span>    <br /><span style="color: rgb(192,192,192)">}</span>    <br /><span style="color: rgb(255,255,255)">?&gt;</span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">&lt;meta</span> <span style="color: rgb(255,255,0)">name=</span><span style="color: rgb(187,187,0)">&quot;keywords&quot;</span> <span style="color: rgb(255,255,0)">content=</span><span style="color: rgb(187,187,0)">&quot;</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">echo</span> <span style="color: rgb(204,204,0)">$keywords</span> <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(187,187,0)">&quot;</span> <span style="color: rgb(255,255,0); font-weight: bold">/&gt;</span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">&lt;meta</span> <span style="color: rgb(255,255,0)">name=</span><span style="color: rgb(187,187,0)">&quot;description&quot;</span> <span style="color: rgb(255,255,0)">content=</span><span style="color: rgb(187,187,0)">&quot;</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">echo</span> <span style="color: rgb(204,204,0)">$description</span> <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(187,187,0)">&quot;</span> <span style="color: rgb(255,255,0); font-weight: bold">/&gt;</span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">&lt;meta</span> <span style="color: rgb(255,255,0)">name=</span><span style="color: rgb(187,187,0)">&quot;author&quot;</span> <span style="color: rgb(255,255,0)">content=</span><span style="color: rgb(187,187,0)">&quot;你的作者&quot;</span> <span style="color: rgb(255,255,0); font-weight: bold">/&gt;</span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">&lt;meta</span> <span style="color: rgb(255,255,0)">name=</span><span style="color: rgb(187,187,0)">&quot;Copyright&quot;</span> <span style="color: rgb(255,255,0)">content=</span><span style="color: rgb(187,187,0)">&quot;你的版权&quot;</span> <span style="color: rgb(255,255,0); font-weight: bold">/&gt;</span>    </div>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/optimization-of-the-description-and-the-keywords-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google自定义搜索设置之搜索元素</title>
		<link>http://fvf.me/wordpress/theme/google-custom-search-to-set-the-search-element.html</link>
		<comments>http://fvf.me/wordpress/theme/google-custom-search-to-set-the-search-element.html#comments</comments>
		<pubDate>Thu, 02 Sep 2010 11:38:00 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[搜索]]></category>
		<category><![CDATA[搜索元素]]></category>
		<category><![CDATA[设置]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/google%e8%87%aa%e5%ae%9a%e4%b9%89%e6%90%9c%e7%b4%a2%e8%ae%be%e7%bd%ae%e4%b9%8b%e6%90%9c%e7%b4%a2%e5%85%83%e7%b4%a0.html</guid>
		<description><![CDATA[今天帮网友找资料，发现网站的搜索页面有的差一点。感觉不爽，就想到了Google自定义搜索，呵呵！去设置新建了一个新的自定义搜索。得到搜索引擎的唯一 ID，其实就是一个自定义搜索个人标识一样。 巧合的是咱这个主题尽然自带支持Google的自定义搜索。本以为把那个个人ID填进去就好了，结果搜索一下发现不行，悲剧的事情啊！看来还是得自己动手丰衣足食啊。 搜索了发现原来有两种设置方法，对应着Google自定义搜索的2个实现方法。方法一，搜索元素：提供大多数布局和自定义选项。方法二，IFRAME：提供的自定义内容有限，且需要为您网站上的搜索结果提供单独网页。当然还有一种方法是，Google 托管的网页。搜索结果位于 Google 上。 方法一：搜索元素 这种方法其实是最好看的，所以我第一个想到就是它，高速Ajax加载，减少主机负担，自定义CSS，自定义展示结果，高亮搜索，而且Adsense集成，Analytics 集成。 开始去Google自定义搜索里面设置-外观-托管选项-搜索元素：提供大多数布局和自定义选项。保存得到代码，不过这个代码不能随便的用，需要修改一下，添加正则表达式的传参代码。复制page.php页面适当修改，制作成cse模板，代码如下 &#60;?php /* Template Name: cse */ ?&#62; &#60;?php get_header(); ?&#62; &#60;div class="post"&#62; &#60;div class="contents"&#62; &#60;div id="cse" style="width: 100%;"&#62;正在从Google 加载搜索结果……&#60;/div&#62; &#60;script src="http://www.google.com/jsapi" type="text/javascript"&#62;&#60;/script&#62; &#60;script type="text/javascript"&#62; google.load(‘search’, ’1′, {language : ‘zh-CN’}); google.setOnLoadCallback(function(){ var customSearchControl = new google.search.CustomSearchControl(‘//换成自己的ID号’); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.draw(‘cse’); var match = location.search.match(/q=([^&#38;]*)(&#38;&#124;$)/); if(match &#38;&#38; match[1]){ [...]]]></description>
			<content:encoded><![CDATA[<p>今天帮网友找资料，发现网站的搜索页面有的差一点。感觉不爽，就想到了<a href="http://www.google.com/cse/?hl=zh-CN">Google自定义搜索</a>，呵呵！去设置新建了一个新的自定义搜索。得到搜索引擎的唯一 ID，其实就是一个自定义搜索个人标识一样。</p>
<p>巧合的是咱这个主题尽然自带支持Google的自定义搜索。本以为把那个个人ID填进去就好了，结果搜索一下发现不行，悲剧的事情啊！看来还是得自己动手丰衣足食啊。</p>
<p>搜索了发现原来有两种设置方法，对应着Google自定义搜索的2个实现方法。方法一，<strong>搜索元素：</strong>提供大多数布局和自定义选项。方法二，<strong>IFRAME：</strong>提供的自定义内容有限，且需要为您网站上的搜索结果提供单独网页。当然还有一种方法是，<strong>Google 托管的网页。</strong>搜索结果位于 Google 上。</p>
<p>方法一：<strong>搜索元素</strong></p>
<p>这种方法其实是最好看的，所以我第一个想到就是它，高速Ajax加载，减少主机负担，自定义CSS，自定义展示结果，高亮搜索，而且Adsense集成，Analytics 集成。</p>
<p>开始去Google自定义搜索里面设置-外观-托管选项-<strong>搜索元素：</strong>提供大多数布局和自定义选项。保存得到代码，不过这个代码不能随便的用，需要修改一下，添加正则表达式的传参代码。复制page.php页面适当修改，制作成cse模板，代码如下</p>
<div class="source" style="background-color: #000000; font-family: tahoma, 'Lucida Console', 'Courier New', verdana; color: #c0c0c0;"><span style="color: #ffffff;">&lt;?php</span><br />
<span style="color: #696969;">/* </span><br />
<span style="color: #696969;">Template Name: cse </span><br />
<span style="color: #696969;">*/</span><br />
<span style="color: #ffffff;">?&gt;</span><br />
<span style="color: #ffffff;">&lt;?php</span> <span style="color: #c0c0c0;">get_header</span>(); <span style="color: #ffffff;">?&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div</span> <span style="color: #ffff00;">class=</span><span style="color: #bbbb00;">"post"</span><span style="color: #ffff00; font-weight: bold;">&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div</span> <span style="color: #ffff00;">class=</span><span style="color: #bbbb00;">"contents"</span><span style="color: #ffff00; font-weight: bold;">&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div</span> <span style="color: #ffff00;">id=</span><span style="color: #bbbb00;">"cse"</span> <span style="color: #ffff00;">style=</span><span style="color: #bbbb00;">"width: 100%;"</span><span style="color: #ffff00; font-weight: bold;">&gt;</span><span style="color: #c0c0c0;">正在从Google 加载搜索结果……</span><span style="color: #ffff00; font-weight: bold;">&lt;/div&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;script </span><span style="color: #ffff00;">src=</span><span style="color: #bbbb00;">"http://www.google.com/jsapi"</span> <span style="color: #ffff00;">type=</span><span style="color: #bbbb00;">"text/javascript"</span><span style="color: #ffff00; font-weight: bold;">&gt;&lt;/script&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;script </span><span style="color: #ffff00;">type=</span><span style="color: #bbbb00;">"text/javascript"</span><span style="color: #ffff00; font-weight: bold;">&gt;</span><br />
<span style="color: #c0c0c0;">google</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">load</span>(<span style="color: #c0c0c0;">‘</span><span style="color: #c0c0c0;">search</span><span style="color: #c0c0c0;">’</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">’</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">′</span><span style="color: #c0c0c0;">,</span> <span style="color: #c0c0c0;">{</span><span style="color: #c0c0c0;">language</span> <span style="color: #c0c0c0;">:</span> <span style="color: #c0c0c0;">‘</span><span style="color: #c0c0c0;">zh</span><span style="color: #c0c0c0;">-</span><span style="color: #c0c0c0;">CN</span><span style="color: #c0c0c0;">’</span><span style="color: #c0c0c0;">});</span><br />
<span style="color: #c0c0c0;">google</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">setOnLoadCallback</span>(<span style="color: #ffff00; font-weight: bold;">function</span><span style="color: #c0c0c0;">(){</span><br />
<span style="color: #ffff00; font-weight: bold;">var</span> <span style="color: #c0c0c0;">customSearchControl</span> <span style="color: #c0c0c0;">=</span> <span style="color: #ffff00; font-weight: bold;">new</span> <span style="color: #c0c0c0;">google</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">search</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">CustomSearchControl</span>(<span style="color: #c0c0c0;">‘</span><span style="color: #696969;">//换成自己的ID号’); </span><br />
<span style="color: #c0c0c0;">customSearchControl</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">setResultSetSize</span>(<span style="color: #c0c0c0;">google</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">search</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">Search</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">FILTERED_CSE_RESULTSET</span>);<br />
<span style="color: #c0c0c0;">customSearchControl</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">draw</span>(<span style="color: #c0c0c0;">‘</span><span style="color: #c0c0c0;">cse</span><span style="color: #c0c0c0;">’</span>);<br />
<span style="color: #ffff00; font-weight: bold;">var</span> <span style="color: #c0c0c0;">match</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">location</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">search</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">match</span>(<span style="color: #bbbb00;">/q=([^&amp;]*)(&amp;|$)/</span>);<br />
<span style="color: #ffff00; font-weight: bold;">if</span>(<span style="color: #c0c0c0;">match</span> <span style="color: #c0c0c0;">&amp;&amp;</span> <span style="color: #c0c0c0;">match</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">]){</span><br />
<span style="color: #ffff00; font-weight: bold;">var</span> <span style="color: #c0c0c0;">search</span> <span style="color: #c0c0c0;">=</span> <span style="color: #c0c0c0;">decodeURIComponent</span>(<span style="color: #c0c0c0;">match</span><span style="color: #c0c0c0;">[</span><span style="color: #c0c0c0;">1</span><span style="color: #c0c0c0;">]);</span><br />
<span style="color: #c0c0c0;">customSearchControl</span><span style="color: #c0c0c0;">.</span><span style="color: #c0c0c0;">execute</span>(<span style="color: #c0c0c0;">search</span>);<br />
<span style="color: #c0c0c0;">}</span><br />
<span style="color: #c0c0c0;">});</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;/script&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;link</span> <span style="color: #ffff00;">rel=</span><span style="color: #bbbb00;">"stylesheet"</span> <span style="color: #ffff00;">href=</span><span style="color: #bbbb00;">"http://www.google.com/cse/style/look/greensky.css"</span> <span style="color: #ffff00;">type=</span><span style="color: #bbbb00;">"text/css"</span> <span style="color: #ffff00; font-weight: bold;">/&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div</span> <span style="color: #ffff00;">class=</span><span style="color: #bbbb00;">"fixed"</span><span style="color: #ffff00; font-weight: bold;">&gt;&lt;/div&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;/div&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;/div&gt;</span><br />
<span style="color: #ffffff;">&lt;?php</span> <span style="color: #c0c0c0;">get_sidebar</span>(); <span style="color: #ffffff;">?&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div</span> <span style="color: #ffff00;">class=</span><span style="color: #bbbb00;">"fixed"</span><span style="color: #ffff00; font-weight: bold;">&gt;&lt;/div&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div</span> <span style="color: #ffff00;">id=</span><span style="color: #bbbb00;">"bottom"</span><span style="color: #ffff00; font-weight: bold;">&gt;</span><br />
<span style="color: #ffffff;">&lt;?php</span> <span style="color: #c0c0c0;">get_footer</span>(); <span style="color: #ffffff;">?&gt;</span></div>
<p>接下来在WP后台新建一个搜索页面，选择页面模板 <strong>cse</strong> 就是刚刚传上去的那个文件，设置永久链接：比如咱的是<a href="http://fvf.me/search">http://fvf.me/search</a>，得到页面的ＩＤ号，比如咱的是130号，点击发表页面。然后修改header.php</p>
<div class="source" style="background-color: #000000; font-family: 'Courier New', 'Lucida Console', verdana; color: #c0c0c0;"><span style="color: #c0c0c0;">wp_list_pages('title_li=0</span><span style="color: #ffffff;">&amp;sort_column=menu_order');</span></div>
<p>修改成刚才获取的页面ID，</p>
<div class="source" style="background-color: #000000; font-family: 'Courier New', 'Lucida Console', verdana; color: #c0c0c0;"><span style="color: #c0c0c0;">wp_list_pages('title_li=0</span><span style="color: #ffffff;">&amp;sort_column=menu_order&amp;exclude=130');</span></div>
<p>这样就能把刚才的搜索页面排除在导航栏之中了。</p>
<p>终于咱有了一个正常使用的search页面，下面开始对首页的搜索条进行修改，用了一个正则来处理传递参数。</p>
<div class="source" style="background-color: #000000; font-family: 'Courier New', 'Lucida Console', verdana; color: #c0c0c0;"><span style="color: #ffff00; font-weight: bold;">&lt;form</span> <span style="color: #ffff00;">method=</span><span style="color: #bbbb00;">"get"</span> <span style="color: #ffff00;">id=</span><span style="color: #bbbb00;">"searchform"</span> <span style="color: #ffff00;">action=</span><span style="color: #bbbb00;">"http://fvf.me/search"</span><span style="color: #ffff00; font-weight: bold;">&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;div&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;input</span> <span style="color: #ffff00;">type=</span><span style="color: #bbbb00;">"text"</span> <span style="color: #ffff00;">value=</span><span style="color: #bbbb00;">"Click Enter…"</span> <span style="color: #ffff00;">name=</span><span style="color: #bbbb00;">"q"</span> <span style="color: #ffff00;">id=</span><span style="color: #bbbb00;">"search_input"</span> <span style="color: #ffff00;">onFocus=</span><span style="color: #bbbb00;">"this.value = this.value == this.defaultValue ? ” : this.value"</span> <span style="color: #ffff00;">onBlur=</span><span style="color: #bbbb00;">"this.value = this.value == ” ? this.defaultValue : this.value"</span> <span style="color: #ffff00; font-weight: bold;">/&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;/div&gt;</span><br />
<span style="color: #ffff00; font-weight: bold;">&lt;/form&gt;</span></div>
<p>现在基本的功能都已经实现了，最后要做的就是优化 CSS，使之看起来跟博客协调！在Google自定义搜索的控制面板选择 外观-搜索元素-自定样式。最下面都有阅览供大家调试。</p>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/google-custom-search-to-set-the-search-element.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>文章页内部导航（面包屑导航）设置</title>
		<link>http://fvf.me/wordpress/theme/the-internal-article-pages-navigation-breadcrumbs-to-set.html</link>
		<comments>http://fvf.me/wordpress/theme/the-internal-article-pages-navigation-breadcrumbs-to-set.html#comments</comments>
		<pubDate>Thu, 05 Aug 2010 11:30:00 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[导航]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/%e6%96%87%e7%ab%a0%e9%a1%b5%e5%86%85%e9%83%a8%e5%af%bc%e8%88%aa%ef%bc%88%e9%9d%a2%e5%8c%85%e5%b1%91%e5%af%bc%e8%88%aa%ef%bc%89%e8%ae%be%e7%bd%ae.html</guid>
		<description><![CDATA[嘿嘿，昨天把置顶文章设置了特殊样式，今天发现这个主题文章页没有面包屑导航， 比如当前这篇文章的面包屑导航为：当前位置: 首页&#62;&#62; WordPress&#62;&#62; 阅读正文 呵呵，其实有这个导航可以方便的告诉浏览者现在处在的位置，增加网站的连贯性。当然对我来说最大的理由就是，我看到别人的网站上有，为什么我的没有呢，所以就要开始自己丰衣足食了。开动起来。 其实对我这种链接的设计其实就是在文章single.php页的某个地方加一个条php代码。一般这些链接的模式是首页&#62;&#62;分类&#62;&#62;文章。 &#60;?php if (have_posts()) : the_post(); ?&#62; //文章查询代码 &#60;div class=&#34;post_nav&#34;&#62; //面包屑导航样式 当前位置: &#60;a href=&#34;&#60;?php echo get_settings(‘home’); ?&#62;&#34; title=&#34;首页&#34;&#62;首页&#60;/a&#62;&#38;gt;&#38;gt; //输出博客主页链接 &#60;?php $categorys = get_the_category(); $category = $categorys[0];echo(get_category_parents($category-&#62;term_id,true,‘&#62;&#62;’)); ?&#62; //当文章有分类时输出分类名&#62;&#62;，如果是多级分类的话会输出大分类&#62;&#62;下级分类&#62;&#62;。 阅读正文&#60;/div&#62; //这里可以用&#60;?php the_title(); ?&#62;代替上面的文章显示文章全标题 接下来就是对面包屑导航层的样式附加了。这样就能产生现在的导航了。]]></description>
			<content:encoded><![CDATA[<p>嘿嘿，昨天把置顶文章设置了特殊样式，今天发现这个主题文章页没有面包屑导航，</p>
<p>比如当前这篇文章的面包屑导航为：当前位置: <a href="http://fvf.me/">首页</a>&gt;&gt; <a href="http://fvf.me/category/wordpress">WordPress</a>&gt;&gt; 阅读正文</p>
<p>呵呵，其实有这个导航可以方便的告诉浏览者现在处在的位置，增加网站的连贯性。当然对我来说最大的理由就是，我看到别人的网站上有，为什么我的没有呢，所以就要开始自己丰衣足食了。开动起来。</p>
<p>其实对我这种链接的设计其实就是在文章single.php页的某个地方加一个条php代码。一般这些链接的模式是首页&gt;&gt;分类&gt;&gt;文章。</p>
<div style="background-color: rgb(0,0,0); font-family: tahoma, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(192,192,192)" class="source"><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">if</span> (<span style="color: rgb(192,192,192)">have_posts</span>()) <span style="color: rgb(192,192,192)">:</span> <span style="color: rgb(192,192,192)">the_post</span>(); <span style="color: rgb(255,255,255)">?&gt;</span>     <br /><span style="color: rgb(192,192,192)">//文章查询代码 </span>    <br /><span style="color: rgb(255,255,0); font-weight: bold">&lt;div</span> <span style="color: rgb(255,255,0)">class=</span><span style="color: rgb(187,187,0)">&quot;post_nav&quot;</span><span style="color: rgb(255,255,0); font-weight: bold">&gt;</span>     <br /><span style="color: rgb(192,192,192)">//面包屑导航样式 </span>    <br /><span style="color: rgb(192,192,192)">当前位置: </span><span style="color: rgb(255,255,0); font-weight: bold">&lt;a</span> <span style="color: rgb(255,255,0)">href=</span><span style="color: rgb(187,187,0)">&quot;</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">echo</span> <span style="color: rgb(192,192,192)">get_settings</span>(<span style="color: rgb(192,192,192)">‘</span><span style="color: rgb(192,192,192)">home</span><span style="color: rgb(192,192,192)">’</span>); <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(187,187,0)">&quot;</span> <span style="color: rgb(255,255,0)">title=</span><span style="color: rgb(187,187,0)">&quot;首页&quot;</span><span style="color: rgb(255,255,0); font-weight: bold">&gt;</span><span style="color: rgb(192,192,192)">首页</span><span style="color: rgb(255,255,0); font-weight: bold">&lt;/a&gt;</span><span style="color: rgb(255,255,255)">&amp;gt;&amp;gt;</span>     <br /><span style="color: rgb(192,192,192)">//输出博客主页链接 </span>    <br /><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(204,204,0)">$categorys</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(192,192,192)">get_the_category</span>(); <span style="color: rgb(204,204,0)">$category</span> <span style="color: rgb(192,192,192)">=</span> <span style="color: rgb(204,204,0)">$categorys</span><span style="color: rgb(192,192,192)">[</span><span style="color: rgb(192,192,192)">0</span><span style="color: rgb(192,192,192)">];</span><span style="color: rgb(255,255,0); font-weight: bold">echo</span>(<span style="color: rgb(192,192,192)">get_category_parents</span>(<span style="color: rgb(204,204,0)">$category</span><span style="color: rgb(192,192,192)">-&gt;</span><span style="color: rgb(255,255,0)">term_id</span><span style="color: rgb(192,192,192)">,</span><span style="color: rgb(255,255,0); font-weight: bold">true</span><span style="color: rgb(192,192,192)">,</span><span style="color: rgb(192,192,192)">‘</span><span style="color: rgb(192,192,192)">&gt;&gt;</span><span style="color: rgb(192,192,192)">’</span>)); <span style="color: rgb(255,255,255)">?&gt;</span>     <br /><span style="color: rgb(192,192,192)">//当文章有分类时输出分类名&gt;&gt;，如果是多级分类的话会输出大分类&gt;&gt;下级分类&gt;&gt;。 </span>    <br /><span style="color: rgb(192,192,192)">阅读正文</span><span style="color: rgb(255,255,0); font-weight: bold">&lt;/div&gt;</span>     <br /><span style="color: rgb(192,192,192)">//这里可以用</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(192,192,192)">the_title</span>(); <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(192,192,192)">代替上面的文章显示文章全标题</span>    </div>
<p>接下来就是对面包屑导航层的样式附加了。这样就能产生现在的导航了。</p>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/the-internal-article-pages-navigation-breadcrumbs-to-set.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>置顶文章设置样式</title>
		<link>http://fvf.me/wordpress/theme/top-articles-set-the-style.html</link>
		<comments>http://fvf.me/wordpress/theme/top-articles-set-the-style.html#comments</comments>
		<pubDate>Wed, 04 Aug 2010 11:32:00 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[置顶]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/%e7%bd%ae%e9%a1%b6%e6%96%87%e7%ab%a0%e8%ae%be%e7%bd%ae%e6%a0%b7%e5%bc%8f.html</guid>
		<description><![CDATA[话说mg12大大的elegant-box主题还真是强大呢，很多功能都用了，都不用直接去安装插件，还有各个地方的公告栏，文章顶的，侧边顶，侧边尾。不过我发现大大主题也还是有一点不足的地方，没办法世界上完美的东西都是没多少。其中就是置顶文章的凸显没有，当设置文章置顶以后，竟然不知道这是置顶文章，没办法只好自己设置一下了。 其实WordPress2.7以后的版本置顶文章都能用is_sticky()函数判断，只要在在页面主循环下加判函数就行了。 &#60;?php if (have_posts()) : while (have_posts()) : the_post(); update_post_caches($posts); ?&#62; //页面主循环 &#160;&#160;&#160; &#60;div class=&#34;post &#60;?php if(is_sticky()) {echo &#34;post-sticky&#34;;} ?&#62;&#34; id=&#34;post-&#60;?php the_ID(); ?&#62;&#34;&#62; //当文章为置顶时，在层中添加 &#34;post-sticky&#34; 的样式 &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;h2 class=&#34;title&#34;&#62; &#160;&#160;&#160;&#160;&#160;&#160; &#60;?php if(is_sticky()) {echo &#34;&#160; &#60;img src='http://www.graygift.com/jing.png' alt=’精’ /&#62; &#34;;} ?&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;a href=&#34;&#60;?php the_permalink() ?&#62;&#34; rel=&#34;bookmark&#34;&#62;&#60;?php the_title(); ?&#62;&#60;/a&#62;&#60;/h2&#62; //当文章为置顶时，在标题前输出精的图标 这样就可以控制置顶文章样式了。只要在ｃｓｓ里面设置post-sticky就行了。 .post{ }//普通文章样式 .post-sticky{ }//置顶文章样式 [...]]]></description>
			<content:encoded><![CDATA[<p>话说mg12大大的elegant-box主题还真是强大呢，很多功能都用了，都不用直接去安装插件，还有各个地方的公告栏，文章顶的，侧边顶，侧边尾。不过我发现大大主题也还是有一点不足的地方，没办法世界上完美的东西都是没多少。其中就是置顶文章的凸显没有，当设置文章置顶以后，竟然不知道这是置顶文章，没办法只好自己设置一下了。</p>
<p>其实WordPress2.7以后的版本置顶文章都能用is_sticky()函数判断，只要在在页面主循环下加判函数就行了。</p>
<div style="background-color: rgb(0,0,0); font-family: tahoma, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(192,192,192)" class="source"><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">if</span> (<span style="color: rgb(192,192,192)">have_posts</span>()) <span style="color: rgb(192,192,192)">:</span> <span style="color: rgb(255,255,0); font-weight: bold">while</span> (<span style="color: rgb(192,192,192)">have_posts</span>()) <span style="color: rgb(192,192,192)">:</span> <span style="color: rgb(192,192,192)">the_post</span>(); <span style="color: rgb(192,192,192)">update_post_caches</span>(<span style="color: rgb(204,204,0)">$posts</span>); <span style="color: rgb(255,255,255)">?&gt;</span>    <br /><span style="color: rgb(192,192,192)">//页面主循环</span>    <br />&#160;&#160;&#160; <span style="color: rgb(255,255,0); font-weight: bold">&lt;div</span> <span style="color: rgb(255,255,0)">class=</span><span style="color: rgb(187,187,0)">&quot;post </span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">if</span>(<span style="color: rgb(192,192,192)">is_sticky</span>()) <span style="color: rgb(192,192,192)">{</span><span style="color: rgb(255,255,0); font-weight: bold">echo</span> <span style="color: rgb(187,187,0)">&quot;post-sticky&quot;</span><span style="color: rgb(192,192,192)">;}</span> <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(187,187,0)">&quot;</span> <span style="color: rgb(255,255,0)">id=</span><span style="color: rgb(187,187,0)">&quot;post-</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(192,192,192)">the_ID</span>(); <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(187,187,0)">&quot;</span><span style="color: rgb(255,255,0); font-weight: bold">&gt;</span>    <br /><span style="color: rgb(192,192,192)">//当文章为置顶时，在层中添加 &quot;post-sticky&quot; 的样式</span>    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: rgb(255,255,0); font-weight: bold">&lt;h2</span> <span style="color: rgb(255,255,0)">class=</span><span style="color: rgb(187,187,0)">&quot;title&quot;</span><span style="color: rgb(255,255,0); font-weight: bold">&gt;</span>    <br />&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(255,255,0); font-weight: bold">if</span>(<span style="color: rgb(192,192,192)">is_sticky</span>()) <span style="color: rgb(192,192,192)">{</span><span style="color: rgb(255,255,0); font-weight: bold">echo</span> <span style="color: rgb(187,187,0)">&quot;&#160; &lt;img src='http://www.graygift.com/jing.png' alt=’精’ /&gt; &quot;</span><span style="color: rgb(192,192,192)">;}</span> <span style="color: rgb(255,255,255)">?&gt;</span>    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: rgb(255,255,0); font-weight: bold">&lt;a</span> <span style="color: rgb(255,255,0)">href=</span><span style="color: rgb(187,187,0)">&quot;</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(192,192,192)">the_permalink</span>() <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(187,187,0)">&quot;</span> <span style="color: rgb(255,255,0)">rel=</span><span style="color: rgb(187,187,0)">&quot;bookmark&quot;</span><span style="color: rgb(255,255,0); font-weight: bold">&gt;</span><span style="color: rgb(255,255,255)">&lt;?php</span> <span style="color: rgb(192,192,192)">the_title</span>(); <span style="color: rgb(255,255,255)">?&gt;</span><span style="color: rgb(255,255,0); font-weight: bold">&lt;/a&gt;&lt;/h2&gt;</span>    <br /><span style="color: rgb(192,192,192)">//当文章为置顶时，在标题前输出精的图标</span>    </div>
<p>这样就可以控制置顶文章样式了。只要在ｃｓｓ里面设置post-sticky就行了。</p>
<div style="background-color: rgb(0,0,0); font-family: tahoma, &#39;Lucida Console&#39;, &#39;Courier New&#39;, verdana; color: rgb(192,192,192)" class="source"><span style="color: rgb(192,192,192)">.post</span><span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(192,192,192)">}</span><span style="color: rgb(192,192,192)">//</span><span style="color: rgb(192,192,192)">普通文章样式</span>    <br /><span style="color: rgb(192,192,192)">.post-sticky</span><span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(192,192,192)">}</span><span style="color: rgb(192,192,192)">//</span><span style="color: rgb(192,192,192)">置顶文章样式</span>    <br /><span style="color: rgb(192,192,192)">.post</span> <span style="color: rgb(192,192,192)">.title</span><span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(192,192,192)">}</span><span style="color: rgb(192,192,192)">//</span><span style="color: rgb(192,192,192)">普通文章标题样式</span>    <br /><span style="color: rgb(192,192,192)">.post-sticky</span> <span style="color: rgb(192,192,192)">.title</span><span style="color: rgb(192,192,192)">{</span>    <br /><span style="color: rgb(192,192,192)">}</span><span style="color: rgb(192,192,192)">//</span><span style="color: rgb(192,192,192)">置顶文章标题样式</span>    </div>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/top-articles-set-the-style.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>隐藏评论输入框</title>
		<link>http://fvf.me/wordpress/theme/hide-comment-input-box.html</link>
		<comments>http://fvf.me/wordpress/theme/hide-comment-input-box.html#comments</comments>
		<pubDate>Sun, 06 Sep 2009 13:41:08 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[评论]]></category>
		<category><![CDATA[输入框]]></category>
		<category><![CDATA[隐藏]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/%e9%9a%90%e8%97%8f%e8%af%84%e8%ae%ba%e8%be%93%e5%85%a5%e6%a1%86.html</guid>
		<description><![CDATA[今天适当的修改了一下评论页，原因是看到了MG12的介绍，提高一下访客评论时的用户体验。嘿嘿，一切为了评论，为了评论的一切！哈哈，有点跑题了！ 究竟是什么体验呢，MG12说的很公式化，我简单通俗的讲：当你在流过一次评论之后，再次评论时，会发现在用户名，邮件地址和网站的方框内会有原先的记录在，你只需要填写评论内容就可以了！为什么呢，原因就在于Cookie的记录。具体的就不讲了，感兴趣的去MG12那里看吧！ 现在我只是把MG12那么复制的原理省略掉，简单化一点，我们只需要按步骤做就可以了，当然要是有兴趣研究一下，就请跳转到MG12那里去。 第一步，打开comments.php文件,找到你主题里的文本输入框: &#60;input type=“text” name=“author” id=“author” value=“&#60;?php echo $comment_author; ?/&#62;” size=”22” tabindex=”1” /&#62; &#60;input type=”text” name=”email” id=”email” value=”&#60;?php echo $comment_author_email; ?/&#62;” size=”22” tabindex=”2” /&#62; &#60;input type=”text” name=”url” id=”url” value=”&#60;?php echo $comment_author_url; ?/&#62;” size=”22” tabindex=”3” /&#62; 当然还包括提示文字。你要做的就是在他们的外面套一个层，这个层的id=author_info就行了！这个层就是你要隐藏的输入框！ 第二步，在author_info这个层的上面加入以下代码，什么用自己去看看MG12的网页！ &#60;!– 有资料的访客 –&#62; &#60;?php if ( $comment_author != “” ) : ?&#62; &#60;!– 转换显示状态用的 JavaScript Q1: [...]]]></description>
			<content:encoded><![CDATA[<p>今天适当的修改了一下评论页，原因是看到了<a href="http://www.neoease.com/wordpress-guest-post/" rel="external">MG12</a>的介绍，提高一下访客评论时的用户体验。嘿嘿，一切为了评论，为了评论的一切！哈哈，有点跑题了！</p>
<p>究竟是什么体验呢，MG12说的很公式化，<strong>我简单通俗的讲：当你在流过一次评论之后，再次评论时，会发现在用户名，邮件地址和网站的方框内会有原先的记录在，你只需要填写评论内容就可以了！</strong>为什么呢，原因就在于Cookie的记录。具体的就不讲了，感兴趣的去MG12那里看吧！</p>
<p>现在我只是把MG12那么复制的原理省略掉，简单化一点，我们只需要按步骤做就可以了，当然要是有兴趣研究一下，就请跳转到MG12那里去。</p>
<h3>第一步，打开comments.php文件,找到你主题里的文本输入框:</h3>
<div class="source" style="font-family: Tahoma, Consolas, 'Lucida Console', 'Courier New'; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;input</span> <span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">“text”</span> <span style="color: rgb(255, 255, 0); ">name=</span><span style="color: rgb(187, 187, 0); ">“author”</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">“author”</span> <span style="color: rgb(255, 255, 0); ">value=</span><span style="color: rgb(187, 187, 0); ">“</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$comment_author</span>; <span style="color: rgb(192, 192, 192); ">?/&gt;</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">size</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">22</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">tabindex</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">1</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">/&gt;</span> <br /> <span style="color: rgb(192, 192, 192); ">&lt;</span><span style="color: rgb(192, 192, 192); ">input</span> <span style="color: rgb(192, 192, 192); ">type</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">text</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">name</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">email</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">id</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">email</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">value</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">&lt;?</span><span style="color: rgb(192, 192, 192); ">php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$comment_author_email</span>; <span style="color: rgb(192, 192, 192); ">?/&gt;</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">size</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">22</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">tabindex</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">2</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">/&gt;</span><br /> <span style="color: rgb(192, 192, 192); ">&lt;</span><span style="color: rgb(192, 192, 192); ">input</span> <span style="color: rgb(192, 192, 192); ">type</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">text</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">name</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">url</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">id</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">url</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">value</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">&lt;?</span><span style="color: rgb(192, 192, 192); ">php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$comment_author_url</span>; <span style="color: rgb(192, 192, 192); ">?/&gt;</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">size</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">22</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">tabindex</span><span style="color: rgb(192, 192, 192); ">=</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(192, 192, 192); ">3</span><span style="color: rgb(192, 192, 192); ">”</span> <span style="color: rgb(192, 192, 192); ">/&gt;</span></div>
<p>当然还包括提示文字。你要做的就是在他们的外面套一个层，这个层的id=author_info就行了！这个层就是你要隐藏的输入框！</p>
<h3>第二步，在author_info这个层的上面加入以下代码，什么用自己去看看MG12的网页！</h3>
<div class="source" style="font-family: Tahoma, Consolas, 'Lucida Console', 'Courier New'; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 255); ">&lt;!– 有资料的访客 –&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span> ( <span style="color: rgb(204, 204, 0); ">$comment_author</span> <span style="color: rgb(192, 192, 192); ">!=</span> <span style="color: rgb(192, 192, 192); ">“”</span> ) <span style="color: rgb(192, 192, 192); ">:</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!–</span><br /> <span style="color: rgb(255, 255, 255); ">转换显示状态用的 JavaScript</span><br /> <span style="color: rgb(255, 255, 255); ">Q1: 为什么这段代码放在这里呢?</span><br /> <span style="color: rgb(255, 255, 255); ">A1: 因为只有当访客有资料时, 它才被用上, 这样可以减少无资料访客下载页面时的开销.</span><br /> <span style="color: rgb(255, 255, 255); ">Q2: 为什么不用外部文件将 JavaScript 放起来? 也许那样维护起来更方便.</span><br /> <span style="color: rgb(255, 255, 255); ">A2: 因为它只在这个地方用到了. 而且加载文件的数量也会影响页面下载速度, 为了这么点字节的代码, 不值得新开一个文件.</span><br /> <span style="color: rgb(255, 255, 255); ">–&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;script </span><span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">“text/javascript”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">function</span> <span style="color: rgb(192, 192, 192); ">setStyleDisplay</span>(<span style="color: rgb(192, 192, 192); ">id</span><span style="color: rgb(192, 192, 192); ">,</span> <span style="color: rgb(192, 192, 192); ">status</span><span style="color: rgb(192, 192, 192); ">){</span><span style="color: rgb(192, 192, 192); ">document</span><span style="color: rgb(192, 192, 192); ">.</span><span style="color: rgb(192, 192, 192); ">getElementById</span>(<span style="color: rgb(192, 192, 192); ">id</span><span style="color: rgb(192, 192, 192); ">).</span><span style="color: rgb(192, 192, 192); ">style</span><span style="color: rgb(192, 192, 192); ">.</span><span style="color: rgb(192, 192, 192); ">display</span> <span style="color: rgb(192, 192, 192); ">=</span> <span style="color: rgb(192, 192, 192); ">status</span><span style="color: rgb(192, 192, 192); ">;}</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/script&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;div</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">“form_row</span> <span style="color: rgb(255, 255, 0); ">small</span><span style="color: rgb(192, 192, 192); ">”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!– 访客昵称 (随便欢迎一下) –&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">printf</span>(<span style="color: rgb(192, 192, 192); ">__</span>(<span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">Welcome</span> <span style="color: rgb(192, 192, 192); ">back</span> <span style="color: rgb(192, 192, 192); ">&lt;</span><span style="color: rgb(192, 192, 192); ">strong</span><span style="color: rgb(192, 192, 192); ">&gt;%</span>s<span style="color: rgb(192, 192, 192); ">&lt;/</span><span style="color: rgb(192, 192, 192); ">strong</span><span style="color: rgb(192, 192, 192); ">&gt;.</span><span style="color: rgb(192, 192, 192); ">’</span><span style="color: rgb(192, 192, 192); ">),</span> <span style="color: rgb(204, 204, 0); ">$comment_author</span>) <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!– 更改按钮 (点击后: 隐藏更改按钮, 显示取消按钮, 显示资料输入框) –&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;span</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">“show_author_info”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;&lt;a</span> <span style="color: rgb(255, 255, 0); ">href=</span><span style="color: rgb(187, 187, 0); ">“javascript:setStyleDisplay(‘author_info’,”);setStyleDisplay(‘show_author_info’,&#39;none’);setStyleDisplay(‘hide_author_info’,”);”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">_e</span>(<span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">Change</span> <span style="color: rgb(192, 192, 192); ">&amp;</span><span style="color: rgb(192, 192, 192); ">raquo</span>;<span style="color: rgb(192, 192, 192); ">’</span>); <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/a&gt;&lt;/span&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!– 取消按钮 (点击后: 显示更改按钮, 隐藏取消按钮, 隐藏资料输入框) –&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;span</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">“hide_author_info”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;&lt;a</span> <span style="color: rgb(255, 255, 0); ">href=</span><span style="color: rgb(187, 187, 0); ">“javascript:setStyleDisplay(‘author_info’,&#39;none’);setStyleDisplay(‘show_author_info’,”);setStyleDisplay(‘hide_author_info’,&#39;none’);”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">_e</span>(<span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">Close</span> <span style="color: rgb(192, 192, 192); ">&amp;</span><span style="color: rgb(192, 192, 192); ">raquo</span>;<span style="color: rgb(192, 192, 192); ">’</span>); <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/a&gt;&lt;/span&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/div&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">endif</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<h3>第三步，在author_info这个层的下面加入以下代码，以上的代码可以删除说明文字。</h3>
<div class="source" style="font-family: Tahoma, Consolas, 'Lucida Console', 'Courier New'; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 255); ">&lt;!– 有资料的访客 –&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span> ( <span style="color: rgb(204, 204, 0); ">$comment_author</span> <span style="color: rgb(192, 192, 192); ">!=</span> <span style="color: rgb(192, 192, 192); ">“”</span> ) <span style="color: rgb(192, 192, 192); ">:</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!– 隐藏取消按钮, 隐藏资料输入框 –&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;script </span><span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">“text/javascript”</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(192, 192, 192); ">setStyleDisplay</span>(<span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">hide_author_info</span><span style="color: rgb(192, 192, 192); ">’</span><span style="color: rgb(192, 192, 192); ">,</span><span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">none</span><span style="color: rgb(192, 192, 192); ">’</span>);<span style="color: rgb(192, 192, 192); ">setStyleDisplay</span>(<span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">author_info</span><span style="color: rgb(192, 192, 192); ">’</span><span style="color: rgb(192, 192, 192); ">,</span><span style="color: rgb(192, 192, 192); ">‘</span><span style="color: rgb(192, 192, 192); ">none</span><span style="color: rgb(192, 192, 192); ">’</span>);<span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/script&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">endif</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<h3>最后全部代码显示如下，（各个主题代码可能有所不同！）</h3>
<div class="source" style="font-family: Tahoma, Consolas, 'Lucida Console', 'Courier New'; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(192, 192, 192); ">!– 有资料的访客 –&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span> ( <span style="color: rgb(204, 204, 0); ">$comment_author</span> <span style="color: rgb(192, 192, 192); ">!=</span> <span style="color: rgb(187, 187, 0); ">&quot;&quot;</span> ) <span style="color: rgb(192, 192, 192); ">:</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 255); ">&lt;!–</span><br /> <span style="color: rgb(255, 255, 255); ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 转换显示状态用的 JavaScript</span><br /> <span style="color: rgb(255, 255, 255); ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Q1: 为什么这段代码放在这里呢?</span><br /> <span style="color: rgb(255, 255, 255); ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A1: 因为只有当访客有资料时, 它才被用上, 这样可以减少无资料访客下载页面时的开销.</span><br /> <span style="color: rgb(255, 255, 255); ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Q2: 为什么不用外部文件将 JavaScript 放起来? 也许那样维护起来更方便.</span><br /> <span style="color: rgb(255, 255, 255); ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A2: 因为它只在这个地方用到了. 而且加载文件的数量也会影响页面下载速度, 为了这么点字节的代码, 不值得新开一个文件.</span><br /> <span style="color: rgb(255, 255, 255); ">&nbsp;&nbsp;&nbsp; –&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;script </span><span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">&quot;text/javascript&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">function</span> <span style="color: rgb(192, 192, 192); ">setStyleDisplay</span>(<span style="color: rgb(192, 192, 192); ">id</span><span style="color: rgb(192, 192, 192); ">,</span> <span style="color: rgb(192, 192, 192); ">status</span><span style="color: rgb(192, 192, 192); ">){</span><span style="color: rgb(192, 192, 192); ">document</span><span style="color: rgb(192, 192, 192); ">.</span><span style="color: rgb(192, 192, 192); ">getElementById</span>(<span style="color: rgb(192, 192, 192); ">id</span><span style="color: rgb(192, 192, 192); ">).</span><span style="color: rgb(192, 192, 192); ">style</span><span style="color: rgb(192, 192, 192); ">.</span><span style="color: rgb(192, 192, 192); ">display</span> <span style="color: rgb(192, 192, 192); ">=</span> <span style="color: rgb(192, 192, 192); ">status</span><span style="color: rgb(192, 192, 192); ">;}</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/script&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;div</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;form_row small&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 255); ">&lt;!– 访客昵称 (随便欢迎一下) –&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">printf</span>(<span style="color: rgb(192, 192, 192); ">__</span>(<span style="color: rgb(187, 187, 0); ">&#39;Welcome back &lt;strong&gt;%s&lt;/strong&gt;.&#39;</span><span style="color: rgb(192, 192, 192); ">),</span> <span style="color: rgb(204, 204, 0); ">$comment_author</span>) <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 255); ">&lt;!– 更改按钮 (点击后: 隐藏更改按钮, 显示取消按钮, 显示资料输入框) –&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;span</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;show_author_info&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;&lt;a</span> <span style="color: rgb(255, 255, 0); ">href=</span><span style="color: rgb(187, 187, 0); ">&quot;javascript:setStyleDisplay(&#39;author_info&#39;,”);setStyleDisplay(‘show_author_info’,'none’);setStyleDisplay(‘hide_author_info’,”);&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">_e</span>(<span style="color: rgb(187, 187, 0); ">&#39;Change &amp;raquo;&#39;</span>); <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/a&gt;&lt;/span&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 255); ">&lt;!– 取消按钮 (点击后: 显示更改按钮, 隐藏取消按钮, 隐藏资料输入框) –&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;span</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;hide_author_info&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;&lt;a</span> <span style="color: rgb(255, 255, 0); ">href=</span><span style="color: rgb(187, 187, 0); ">&quot;javascript:setStyleDisplay(&#39;author_info&#39;,’none’);setStyleDisplay(‘show_author_info’,”);setStyleDisplay(‘hide_author_info’,'none’);&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">_e</span>(<span style="color: rgb(187, 187, 0); ">&#39;Close &amp;raquo;&#39;</span>); <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/a&gt;&lt;/span&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/div&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">endif</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!– 资料输入框 –&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;div</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;author_info&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;div</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;form_row&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;input</span> <span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">&quot;text&quot;</span> <span style="color: rgb(255, 255, 0); ">name=</span><span style="color: rgb(187, 187, 0); ">&quot;author&quot;</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;author&quot;</span> <span style="color: rgb(255, 255, 0); ">value=</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$comment_author</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span> <span style="color: rgb(255, 255, 0); ">tabindex=</span><span style="color: rgb(187, 187, 0); ">&quot;1&quot;</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">/&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;label</span> <span style="color: rgb(255, 255, 0); ">for=</span><span style="color: rgb(187, 187, 0); ">&quot;author&quot;</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;small&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(192, 192, 192); ">用户名</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span> (<span style="color: rgb(204, 204, 0); ">$req</span>) <span style="color: rgb(192, 192, 192); ">_e</span>(<span style="color: rgb(187, 187, 0); ">&#39;(required)&#39;</span>); <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/label&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/div&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;div</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;form_row&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;input</span> <span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">&quot;text&quot;</span> <span style="color: rgb(255, 255, 0); ">name=</span><span style="color: rgb(187, 187, 0); ">&quot;email&quot;</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;email&quot;</span> <span style="color: rgb(255, 255, 0); ">value=</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$comment_author_email</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span> <span style="color: rgb(255, 255, 0); ">tabindex=</span><span style="color: rgb(187, 187, 0); ">&quot;2&quot;</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">/&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;label</span> <span style="color: rgb(255, 255, 0); ">for=</span><span style="color: rgb(187, 187, 0); ">&quot;email&quot;</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;small&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(192, 192, 192); ">Email地址</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span> (<span style="color: rgb(204, 204, 0); ">$req</span>) <span style="color: rgb(192, 192, 192); ">_e</span>(<span style="color: rgb(187, 187, 0); ">&#39;(required)&#39;</span>); <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/label&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/div&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;div</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;form_row&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;input</span> <span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">&quot;text&quot;</span> <span style="color: rgb(255, 255, 0); ">name=</span><span style="color: rgb(187, 187, 0); ">&quot;url&quot;</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;url&quot;</span> <span style="color: rgb(255, 255, 0); ">value=</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$comment_author_url</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span> <span style="color: rgb(255, 255, 0); ">tabindex=</span><span style="color: rgb(187, 187, 0); ">&quot;3&quot;</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">/&gt;</span><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;label</span> <span style="color: rgb(255, 255, 0); ">for=</span><span style="color: rgb(187, 187, 0); ">&quot;url&quot;</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;small&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(192, 192, 192); ">网站地址</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/label&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/div&gt;</span><br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/div&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;!– 有资料的访客 –&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span> ( <span style="color: rgb(204, 204, 0); ">$comment_author</span> <span style="color: rgb(192, 192, 192); ">!=</span> <span style="color: rgb(187, 187, 0); ">&quot;&quot;</span> ) <span style="color: rgb(192, 192, 192); ">:</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 255); ">&lt;!– 隐藏取消按钮, 隐藏资料输入框 –&gt;</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;script </span><span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(187, 187, 0); ">&quot;text/javascript&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span><span style="color: rgb(192, 192, 192); ">setStyleDisplay</span>(<span style="color: rgb(187, 187, 0); ">&#39;hide_author_info&#39;</span><span style="color: rgb(192, 192, 192); ">,</span><span style="color: rgb(187, 187, 0); ">&#39;none&#39;</span>);<span style="color: rgb(192, 192, 192); ">setStyleDisplay</span>(<span style="color: rgb(187, 187, 0); ">&#39;author_info&#39;</span><span style="color: rgb(192, 192, 192); ">,</span><span style="color: rgb(187, 187, 0); ">&#39;none&#39;</span>);<span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;/script&gt;</span><br /> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">endif</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<p>好了，我已经说的再简单不过了，如果还是不明白那么就给我留言吧！</p>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/hide-comment-input-box.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>区分作者的评论</title>
		<link>http://fvf.me/wordpress/theme/distinction-between-the-authoru002639s-comments.html</link>
		<comments>http://fvf.me/wordpress/theme/distinction-between-the-authoru002639s-comments.html#comments</comments>
		<pubDate>Sun, 23 Aug 2009 02:50:10 +0000</pubDate>
		<dc:creator>死兔子</dc:creator>
				<category><![CDATA[主题]]></category>
		<category><![CDATA[区分作者]]></category>
		<category><![CDATA[评论]]></category>

		<guid isPermaLink="false">http://fvf.me/wordpress/theme/%e5%8c%ba%e5%88%86%e4%bd%9c%e8%80%85%e7%9a%84%e8%af%84%e8%ae%ba.html</guid>
		<description><![CDATA[简单的讲就是代码靠评论人邮件地址来判断是否是作者，如果是就给它加上一个作者的专用样式，而我们就靠这样式来区分作者的评论！]]></description>
			<content:encoded><![CDATA[<p>通常来讲博客文章会有很多评论，怎样快速区分作者的评论呢，特别是当博客主题里没有使用嵌套评论功能时？其实方法很简单，那就是给作者一个和别人不同的评论样式，这样的话读者就能很快找到作者的回复了。</p>
<p><strong>简单的讲就是代码靠评论人邮件地址来判断是否是作者，如果是就给它加上一个作者的专用样式，而我们就靠这样式来区分作者的评论！</strong></p>
<p>解决方案：</p>
<p>1.打开comments.php文件并且找到如下语句：</p>
<div class="source" style="color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); font-family: 'Courier New', 'Lucida Console', Verdana; "> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">foreach</span> <span style="color: rgb(192, 192, 192); ">comment</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">as</span> <span style="color: rgb(204, 204, 0); ">$comment</span>) <span style="color: rgb(192, 192, 192); ">{</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<p>在代码的下一行，插入如下判断代码： </p>
<div class="source" style="color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); font-family: 'Courier New', 'Lucida Console', Verdana; "> <span style="color: rgb(255, 255, 255); ">&lt;?php</span><br /> <span style="color: rgb(204, 204, 0); ">$isByAuthor</span> <span style="color: rgb(192, 192, 192); ">=</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">false</span>;<br /> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span>(<span style="color: rgb(204, 204, 0); ">$comment</span><span style="color: rgb(192, 192, 192); ">-&gt;</span><span style="color: rgb(255, 255, 0); ">comment_author_email</span> <span style="color: rgb(192, 192, 192); ">==</span> <span style="color: rgb(192, 192, 192); ">get_the_author_email</span>()) <span style="color: rgb(192, 192, 192); ">{</span><br /> <span style="color: rgb(204, 204, 0); ">$isByAuthor</span> <span style="color: rgb(192, 192, 192); ">=</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">true</span>;<br /> <span style="color: rgb(192, 192, 192); ">}</span><br /> <span style="color: rgb(255, 255, 255); ">?&gt;</span></div>
<p>2.找到以下这行评论的代码（不同主题可能有所变化）: </p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;li</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$oddcomment</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;comment-</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">comment_ID</span>() <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;</span></div>
<p>用以下的代码替换掉上面的代码，意思是如果是作者的评论我们就输出作者的评论样式： </p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(255, 255, 0); font-weight: bold; ">&lt;li</span> <span style="color: rgb(255, 255, 0); ">class=</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(204, 204, 0); ">$oddcomment</span>; <span style="color: rgb(255, 255, 255); ">?&gt;</span> <span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(255, 255, 0); font-weight: bold; ">if</span>(<span style="color: rgb(204, 204, 0); ">$isByAuthor</span> ) <span style="color: rgb(192, 192, 192); ">{</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">echo</span> <span style="color: rgb(187, 187, 0); ">&#39;authorcomment&#39;</span><span style="color: rgb(192, 192, 192); ">;}</span> <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(187, 187, 0); ">&quot;comment-</span><span style="color: rgb(255, 255, 255); ">&lt;?php</span> <span style="color: rgb(192, 192, 192); ">comment_ID</span>() <span style="color: rgb(255, 255, 255); ">?&gt;</span><span style="color: rgb(187, 187, 0); ">&quot;</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">&gt;&lt;/li&gt;</span></div>
<p>3.最后我们为作者的评论建立一个CSS分类，打开style.css文件并插入如下代码。选择你自己的颜色来替代例子中的颜色。 </p>
<div class="source" style="font-family: 'Courier New', 'Lucida Console', Verdana; color: rgb(192, 192, 192); background-color: rgb(0, 0, 0); "> <span style="color: rgb(192, 192, 192); ">.authorcomment</span><span style="color: rgb(192, 192, 192); ">{</span><br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">color</span><span style="color: rgb(192, 192, 192); ">:</span><span style="color: rgb(192, 192, 192); ">#fff</span>;<br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">font-weight</span><span style="color: rgb(192, 192, 192); ">:</span><span style="color: rgb(255, 255, 0); font-weight: bold; ">bold</span>;<br /> &nbsp;&nbsp;&nbsp; <span style="color: rgb(255, 255, 0); font-weight: bold; ">background</span><span style="color: rgb(192, 192, 192); ">:</span><span style="color: rgb(192, 192, 192); ">#068</span>;<br /> <span style="color: rgb(192, 192, 192); ">}</span></div>
<p>以上的代码会比较每个评论人的邮件地址。如果邮件地址匹配$isByAuthor会返回真值。当显示评论的时候$isByAuthor的值会被检查，如果返回真值，那么authorcomment类被添加到容器中。</p>
<p>在Wordpress2.7以上版本这个可以变得更加简单，只有添加comment_class()表单，在作者评论的时候它会自动添加作者的标签。 </p>
<p>翻译: <a href="http://aonach.com/chatter/highlight-author-comments-in-wordpress/" rel="external" class="broken_link">http://aonach.com/chatter/highlight-author-comments-in-wordpress/</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://fvf.me/wordpress/theme/distinction-between-the-authoru002639s-comments.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

