<?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>Linux ABC &#187; wordpress</title>
	<atom:link href="http://www.linuxabc.net.cn/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxabc.net.cn</link>
	<description>那些人/那些事...</description>
	<lastBuildDate>Tue, 09 Feb 2010 14:09:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>如何在DreamHost中升级wordpress</title>
		<link>http://www.linuxabc.net.cn/wordpress/how-to-upgrade-wordpress-on-dreamhost.html</link>
		<comments>http://www.linuxabc.net.cn/wordpress/how-to-upgrade-wordpress-on-dreamhost.html#comments</comments>
		<pubDate>Mon, 01 Jun 2009 04:52:35 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[dreamhost]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/wordpress/how-to-upgrade-wordpress-on-dreamhost.html</guid>
		<description><![CDATA[linuxabc租用的是DreamHost的空间，该空间提供了PHP+MySQL，用户可通过SSH或者Web panel进行管理，由于我是跟别人合租的，因此没有Web Panel的管理权限，也罢，SSH更适合我一点，方便、快捷。
2.7.1相对于2.6而言融入了很多新的特性，出来也有一段时间了，已趋稳定，因此我打算升级到2.7.1，与此同时，放弃了自己打造theme的幻想，直接用Jinwen的js-o3-lite，网页设计还真不是自己的强项。
wordpress升级很方便，基本的步骤是用新的wordpress替换掉就版本的wordpress，然后重新更新一下数据库即可。
1、用FlashFXP将2.7.1压缩包上传到DreamHost
2、备份旧的wordpress

user@computer:$ tar cvf linuxabc.net.cn.20090530 linuxabc.net.cn/

3、将wp-config.php拷贝出来

user@computer:$ cp wp-config.php ../

4、删除linuxabc.net.cn目录

user@computer:$ rm -rf linuxabc.net.cn/

5、将新版本的wordpress解压到linuxabc.net.cn

user@computer:$ tar zxvf wordpressxx.tar.gz linuxabc.net.cn

6、根据旧的wp-config.php更改linuxabc.net.cn/wp-config.php 
主要是数据库的用户名和密码
7、在IE中打开http://www.linuxabc.net.cn/wp-admin.php
这时会出现要求更新数据库的提示，点击“确定”即可完成整个升级步骤，非常简单。
]]></description>
			<content:encoded><![CDATA[<p>linuxabc租用的是DreamHost的空间，该空间提供了PHP+MySQL，用户可通过SSH或者Web panel进行管理，由于我是跟别人合租的，因此没有Web Panel的管理权限，也罢，SSH更适合我一点，方便、快捷。</p>
<p>2.7.1相对于2.6而言融入了很多新的特性，出来也有一段时间了，已趋稳定，因此我打算升级到2.7.1，与此同时，放弃了自己打造theme的幻想，直接用Jinwen的js-o3-lite，网页设计还真不是自己的强项。</p>
<p>wordpress升级很方便，基本的步骤是用新的wordpress替换掉就版本的wordpress，然后重新更新一下数据库即可。</p>
<h5>1、用FlashFXP将2.7.1压缩包上传到DreamHost</h5>
<h5>2、备份旧的wordpress</h5>

<div class="wp-terminal">user@computer:$ tar cvf linuxabc.net.cn.20090530 linuxabc.net.cn/<br/></div>

<h5>3、将wp-config.php拷贝出来</h5>

<div class="wp-terminal">user@computer:$ cp wp-config.php ../<br/></div>

<h5>4、删除linuxabc.net.cn目录</h5>

<div class="wp-terminal">user@computer:$ rm -rf linuxabc.net.cn/<br/></div>

<h5>5、将新版本的wordpress解压到linuxabc.net.cn</h5>

<div class="wp-terminal">user@computer:$ tar zxvf wordpressxx.tar.gz linuxabc.net.cn<br/></div>

<h5>6、根据旧的wp-config.php更改linuxabc.net.cn/wp-config.php</a> </h5>
<p>主要是数据库的用户名和密码</p>
<h5>7、在IE中打开http://www.linuxabc.net.cn/wp-admin.php</h5>
<p>这时会出现要求更新数据库的提示，点击“确定”即可完成整个升级步骤，非常简单。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/wordpress/how-to-upgrade-wordpress-on-dreamhost.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LinuxABC主题之等高布局</title>
		<link>http://www.linuxabc.net.cn/uncategorized/how-to-make-linuxabc-theme-from-scratch_equal-height-layout.html</link>
		<comments>http://www.linuxabc.net.cn/uncategorized/how-to-make-linuxabc-theme-from-scratch_equal-height-layout.html#comments</comments>
		<pubDate>Tue, 09 Dec 2008 16:25:16 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[其他]]></category>
		<category><![CDATA[linuxabc]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/uncategorized/how-to-make-linuxabc-theme-from-scratch_equal-height-layout.html/</guid>
		<description><![CDATA[LinuxABC采用了传统的布局：
 
由于目前content和sidebar未设背景色，沿用了body的#，显得很呆板，而且读者不容易将视线聚焦在左边的内容上，所以alfie决定将content的背景色改成白色，sidebar的颜色改成灰色系，改完之后发现两边不等高，如下图的左边所示，其实alfie的的初衷是实现右边的效果。
 
于是上网搜了一下，原来这个问题早已有之，众人也是八仙过海各显神通，总结了一下有以下四种解决方法。
一、分层交错法
英文原文是：Equal Height Columns with Cross-Browser CSS &#38; No Hacks 
原文的例子是三栏的，定义三个不同背景色的div：
 
通过控制width的百分比，将各个层错落显示，达到每个col显示不同的颜色，而且是等高的。
 
详细的实现方式请参阅原文。
二、border-right
alfie无意中进入http://www.alistapart.com/，看到了border-right这种解决方式，下面以LinuxABC为例简要说明。
首先将wrapper的背景色设为白色，content也设为白色，并且border-right的宽度为sidebar的宽度，sidebar的背景色设为#EDEDED 

当content高于sidebar时，由于content的border-right的颜色即为sidebar的背景色，因此sidebar短缺的部分由content的border-right背景色不足；
当sidebar高于content时，由于wrapper是content和sidebar的父容器，content短缺的背景由wrapper补足；

这样就实现了两栏等高的问题，如果读者想知道三栏的实现方式，可以参考原文：Multi-Column Layouts Climb Out of the Box 
index.php: 

&#60;div id=&#34;wrapper&#34;&#62; &#60;div id=&#34;content&#34;&#62;This is the content&#60;/div&#62; &#60;div id=&#34;sidebar&#34;&#62;This is the sidebar&#60;/div&#62; &#60;/div&#62;

style.css: 

#wrapper&#123;
   background-color: #FFFFFF;
   overflow: hidden;
   width: 100%;
&#125;
#content&#123;
   background-color: #FFFFFF;
   width: [...]]]></description>
			<content:encoded><![CDATA[<p>LinuxABC采用了传统的布局：</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/classicallayoutwithfloats.png"><img title="classical-layout-with-floats" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="338" alt="classical-layout-with-floats" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/classicallayoutwithfloats-thumb.png" width="500" border="0" /></a> </p>
<p>由于目前content和sidebar未设背景色，沿用了body的#，显得很呆板，而且读者不容易将视线聚焦在左边的内容上，所以alfie决定将content的背景色改成白色，sidebar的颜色改成灰色系，改完之后发现两边不等高，如下图的左边所示，其实alfie的的初衷是实现右边的效果。</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/equalheightcolumnsproblem.gif"><img title="equal-height-columns-problem" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="250" alt="equal-height-columns-problem" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/equalheightcolumnsproblem-thumb.gif" width="450" border="0" /></a> </p>
<p>于是上网搜了一下，原来这个问题早已有之，众人也是八仙过海各显神通，总结了一下有以下四种解决方法。</p>
<h4>一、分层交错法</h4>
<p>英文原文是：<a title="Equal Height Columns with Cross-Browser CSS &amp; No Hacks" href="http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks " target="_blank">Equal Height Columns with Cross-Browser CSS &amp; No Hacks</a> </p>
<p>原文的例子是三栏的，定义三个不同背景色的div：</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/equalheightcolumns3containers.gif"><img title="equal-height-columns-3-containers" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="205" alt="equal-height-columns-3-containers" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/equalheightcolumns3containers-thumb.gif" width="350" border="0" /></a> </p>
<p>通过控制width的百分比，将各个层错落显示，达到每个col显示不同的颜色，而且是等高的。</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/equalheightcolumnscontainerpositions.gif"><img title="equal-height-columns-container-positions" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="632" alt="equal-height-columns-container-positions" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/equalheightcolumnscontainerpositions-thumb.gif" width="497" border="0" /></a> </p>
<p>详细的实现方式请参阅原文。</p>
<h4>二、border-right</h4>
<p>alfie无意中进入<a href="http://www.alistapart.com/">http://www.alistapart.com/</a>，看到了border-right这种解决方式，下面以LinuxABC为例简要说明。</p>
<p>首先将wrapper的背景色设为白色，content也设为白色，并且border-right的宽度为sidebar的宽度，sidebar的背景色设为#EDEDED </p>
<ul>
<li>当content高于sidebar时，由于content的border-right的颜色即为sidebar的背景色，因此sidebar短缺的部分由content的border-right背景色不足；</li>
<li>当sidebar高于content时，由于wrapper是content和sidebar的父容器，content短缺的背景由wrapper补足；</li>
</ul>
<p>这样就实现了两栏等高的问题，如果读者想知道三栏的实现方式，可以参考原文：<a title="Multi-Column Layouts Climb Out of the Box" href="http://www.alistapart.com/articles/multicolumnlayouts " target="_blank">Multi-Column Layouts Climb Out of the Box</a> </p>
<h5>index.php: </h5>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;wrapper&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span><span style="color: #339933;">&gt;</span>This is the content<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;sidebar&quot;</span><span style="color: #339933;">&gt;</span>This is the sidebar<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<h5>style.css: </h5>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrapper</span><span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">100</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#content</span><span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">600px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#EDEDED</span><span style="color: #00AA00;">;</span> 
   <span style="color: #808080; font-style: italic;">/* The width and color of the sidebar */</span>
   <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-400px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#sidebar</span><span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#EDEDED</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>说明：知道<a href="http://www.alistapart.com/">http://www.alistapart.com/</a>是谁创建的吗？是《网站重构》的作者Jeffrey Zeldman，alfie也是今天到书店无意中在《网站重构》这本书中发现的，这个世界好奇妙。</p>
<h4>三、JavaScript</h4>
<p>通过JavaScript或jquery的插件也可以实现多栏之间的等高，不过这种方式应用面不广，所以这里就不详谈了。</p>
<h4>四、table</h4>
<p>这是下下策，在没有css之前table的确是网页设计师的挚爱，但现已经是昔日黄花了，不提也罢。</p>
<p>alfie最终决定采用第二种方法，因为它够简单，效果也不错，方法一虽然很强大，但似乎过于小题大做了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/uncategorized/how-to-make-linuxabc-theme-from-scratch_equal-height-layout.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LinuxABC主题之圆角</title>
		<link>http://www.linuxabc.net.cn/wordpress/how-to-make-linuxabc-theme-from-scratch_rounded-corners.html</link>
		<comments>http://www.linuxabc.net.cn/wordpress/how-to-make-linuxabc-theme-from-scratch_rounded-corners.html#comments</comments>
		<pubDate>Tue, 09 Dec 2008 15:05:28 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[linuxabc]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/wordpress/how-to-make-linuxabc-theme-from-scratch_rounded-corners.html/</guid>
		<description><![CDATA[在web2.0的时代，网页设计大量采用了圆角效果，套用《大腕》里的一句台词就是“你不圆都不好意思跟别人打招呼。”，alfie也不能免俗，决定为LinuxABC的页面元素加入圆角效果。
目前实现圆角效果的主流方式有两种，一种是CSS+DIV，另一种是使用圆角图片。这两种方法对alfie来说都不方便，第一种需要掌握复杂的div嵌套，而且圆角无法做到抗锯齿；第二种则需要使用图像处理工具，而alfie最怕的就是去学习photoshop这个庞然大物，所以决定另辟蹊径。
曾经见过有人用JavaScript解决过圆角问题，而LinuxABC将大量采用jquery，所以alfie搜索了一下jquery的官方网站，还真的有好事者做了圆角效果的插件，而且还不少：

JQuery Curvy Corners 
JCorners 
JQuery Corner Gallery 
rounded corners 

对比一下上面几个插件，alfie最终决定采用rounded corners。因为另外三个插件不支持在div里直接提供参数，当多个页面元素的圆角弧度均不相同的时候需要用户在$(&#34;#ElementID&#34;).corner()中单独提供参数，这就造成展示层跟代码层的混合，不利于后期的维护。下面以一个例子展示JQuery Corner Galley和Rounded Corners两个插件的不同之处。
为LinuxABC的

topNavi的左上角和右上角做圆角效果； 
wrapper的左下角和右下角做圆角效果； 

&#160;  
JQuery Corner Galley：

&#60;script&#62;
   $(document).ready(function(){
      ...
      $('#topNavi').corner(&#34;round top 4px&#34;);
      $('#content').corner(&#34;round bottom 5px&#34;);
      ...
   });
&#60;/script&#62;
&#60;div id=&#34;topNavi&#34;&#62;...&#60;/div&#62;
&#60;div [...]]]></description>
			<content:encoded><![CDATA[<p>在web2.0的时代，网页设计大量采用了圆角效果，套用《大腕》里的一句台词就是“你不圆都不好意思跟别人打招呼。”，alfie也不能免俗，决定为LinuxABC的页面元素加入圆角效果。</p>
<p>目前实现圆角效果的主流方式有两种，一种是CSS+DIV，另一种是使用圆角图片。这两种方法对alfie来说都不方便，第一种需要掌握复杂的div嵌套，而且圆角无法做到抗锯齿；第二种则需要使用图像处理工具，而alfie最怕的就是去学习photoshop这个庞然大物，所以决定另辟蹊径。</p>
<p>曾经见过有人用JavaScript解决过圆角问题，而LinuxABC将大量采用jquery，所以alfie搜索了一下jquery的官方网站，还真的有好事者做了圆角效果的插件，而且还不少：</p>
<ol>
<li><a title="JQuery Curvy Corners" href="http://plugins.jquery.com/project/curvy-corners" target="_blank">JQuery Curvy Corners</a> </li>
<li><a title="JCorners" href="http://plugins.jquery.com/project/JCorners" target="_blank">JCorners</a> </li>
<li><a title="JQuery Corner Gallery" href="http://methvin.com/jquery/jq-corner.html" target="_blank">JQuery Corner Gallery</a> </li>
<li><a title="rounded corners" href="http://plugins.jquery.com/project/corners" target="_blank">rounded corners</a> </li>
</ol>
<p>对比一下上面几个插件，alfie最终决定采用rounded corners。因为另外三个插件不支持在div里直接提供参数，当多个页面元素的圆角弧度均不相同的时候需要用户在$(&quot;#ElementID&quot;).corner()中单独提供参数，这就造成展示层跟代码层的混合，不利于后期的维护。下面以一个例子展示JQuery Corner Galley和Rounded Corners两个插件的不同之处。</p>
<h6>为LinuxABC的</h6>
<ol>
<li>topNavi的左上角和右上角做圆角效果； </li>
<li>wrapper的左下角和右下角做圆角效果； </li>
</ol>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/topnaviroundedcornerssample.png"><img title="topnavi.rounded.corners.sample" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="46" alt="topnavi.rounded.corners.sample" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/topnaviroundedcornerssample-thumb.png" width="204" align="left" border="0" /></a>&#160; <a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/wrapperbottomroundedcornerssample.png"><img title="wrapper.bottom.rounded.corners.sample" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="wrapper.bottom.rounded.corners.sample" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/12/wrapperbottomroundedcornerssample-thumb.png" width="204" border="0" /></a> </p>
<h5>JQuery Corner Galley：</h5>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script&gt;
   $(document).ready(function(){
      ...
      $('#topNavi').corner(&quot;round top 4px&quot;);
      $('#content').corner(&quot;round bottom 5px&quot;);
      ...
   });
&lt;/script&gt;
&lt;div id=&quot;topNavi&quot;&gt;...&lt;/div&gt;
&lt;div id=&quot;content&quot;&gt;...&lt;/div&gt;</pre></div></div>

<h5>Rounded Corners：</h5>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script&gt;
   $(document).ready(function(){
      ...
      $('.rounded').corner();
      ...
   });
&lt;/script&gt;
&lt;div class=&quot;rounded {4px top}&quot; id=&quot;topNavi&quot;&gt;...&lt;/div&gt;
&lt;div class=&quot;rounded {5px bottom-left}&quot; id=&quot;content&quot;&gt;...&lt;/div&gt;</pre></div></div>

<p>rounded corners这种方式无疑更方便些，而且后期的维护相对简单。 </p>
<p>短短几行代码就能搞定大部分的圆角效果，jquery实在是太神奇，想不爱她都不行！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/wordpress/how-to-make-linuxabc-theme-from-scratch_rounded-corners.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress中代码高亮显示的三种方式</title>
		<link>http://www.linuxabc.net.cn/uncategorized/three-way-to-highlight-the-code-block-in-wordpress.html</link>
		<comments>http://www.linuxabc.net.cn/uncategorized/three-way-to-highlight-the-code-block-in-wordpress.html#comments</comments>
		<pubDate>Fri, 10 Oct 2008 17:14:39 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[其他]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/uncategorized/three-way-to-highlight-the-code-block-in-wordpress.html/</guid>
		<description><![CDATA[由于alfie经常要写技术文档，经常需要在文章中插入代码块，于是比较了几种代码高亮的解决方案。
一、通过style.css格式化代码块
这种方式是最原始的，一般的主题的样式表中都会有都会有类似下面的语句：
 code{    &#160;&#160;&#160; font:1em 'Courier New',Courier,Fixed;     &#160;&#160;&#160; display:block;     &#160;&#160;&#160; overflow:auto;     &#160;&#160;&#160; text-align:left;     &#160;&#160;&#160; margin: 10px 0;     &#160;&#160;&#160; padding: 5px 10px;     &#160;&#160;&#160; background: #FBF5DF;     &#160;&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>由于alfie经常要写技术文档，经常需要在文章中插入代码块，于是比较了几种代码高亮的解决方案。</p>
<h3>一、通过style.css格式化代码块</h3>
<p>这种方式是最原始的，一般的主题的样式表中都会有都会有类似下面的语句：</p>
<p> <code>code{    <br />&#160;&#160;&#160; font:1em 'Courier New',Courier,Fixed;     <br />&#160;&#160;&#160; display:block;     <br />&#160;&#160;&#160; overflow:auto;     <br />&#160;&#160;&#160; text-align:left;     <br />&#160;&#160;&#160; margin: 10px 0;     <br />&#160;&#160;&#160; padding: 5px 10px;     <br />&#160;&#160;&#160; background: #FBF5DF;     <br />&#160;&#160;&#160; border-top: solid 1px #EDE0B3;     <br />&#160;&#160;&#160; border-bottom: solid 1px #EDE0B3;     <br />} </code>  <br /> 
<p>只需要在代码块前后加上&lt;code&gt; 和&lt;/code&gt;就可以在文章中简单的格式化代码块了，不过这种方式比较简陋，仅能实现代码的字体和大小，无法实现关键字高亮、缩进等。<strong>效果见上</strong></p>
<p><span id="more-65"></span></p>
<p><strong></strong></p>
<h3>二、在文章中直接插入已格式化好的代码</h3>
<p>网友Unmi(隔叶黄莺)在dp.SyntaxHighlighter的基础上写了一个代码高亮的工具：CodeRender，它有自己的样式表，并提供格式化功能，可以依据各种不同语言的关键字进行高亮显示，用户只需要将格式化好后的&lt;div&gt;块插入文章中即可。下面是CodeRender工具的截图：</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/coderendersample.png"><img title="coderender.sample" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="288" alt="coderender.sample" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/coderendersample-thumb.png" width="404" border="0" /></a>&#160; 下面则是使用CodeRender的效果：</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/coderendersample1.png"><img title="coderender.sample" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="120" alt="coderender.sample" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/coderendersample-thumb1.png" width="404" border="0" /></a>&#160; </p>
<h3>三、使用wp-syntax插件</h3>
<p>wp-syntax是一个专门用于代码高亮的wp插件，它是基于geshi这个php开源程序进行二次开发的，支持的语言种类异常丰富，用户只需要在写文章的时候，在代码块前后加上：&lt;pre lang=”Lanuage”&gt;和&lt;/pre&gt;，后台就会自动帮你格式化代码了，下面是效果图：</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/wp-syntaxsample.png"><img title="wp_syntax.sample" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="88" alt="wp_syntax.sample" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/wp-syntaxsample-thumb.png" width="404" border="0" /></a> </p>
<p>对比三种方式，第一种最简单，但是功能最弱，无法满足要求；第二种灵活性最强，即使更换了blog系统，文章内的代码块效果依然保持不变，但是用户使用麻烦，需要频繁的在CodeRender和blog编辑器间切换；第三种使用比较方便，而且效果最佳，唯一的劣势仅限于wordpress平台，万一哪天换了平台，原有文章的代码块效果就消失了。不过一旦用上了wordpress，更换其它blog系统的可能性就很小了，因为它是如此的漂亮和优雅。</p>
<p>因而，建议采用wp-syntax插件这种方式，类似的插件还有国人编写的coolcode，有兴趣的读者也可以试一下。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/uncategorized/three-way-to-highlight-the-code-block-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何在不同页面间使用不同的样式表</title>
		<link>http://www.linuxabc.net.cn/wordpress/using-different-css-on-different-pages.html</link>
		<comments>http://www.linuxabc.net.cn/wordpress/using-different-css-on-different-pages.html#comments</comments>
		<pubDate>Mon, 29 Sep 2008 18:50:09 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/wordpress/using-different-css-on-different-pages.html/</guid>
		<description><![CDATA[大多数主题使用一个统一的样式表: style.css，这并不能满足一些特殊需要，例如linxuabc的首页(index.php)和全文页(single.php)布局就不一样，所以需要实现在不同页面中使用不同的样式表。


 
&#160; wordpress的动态页面都是通过调用header.php来构造的，而header.php定义了当前页面的样式表，所以解决的思路是判断当前是什么页面，然后根据不同的页面调用不同的样式表。下面是linuxabc中header.php关于css调用的代码

1
2
3
4
5
&#60;?php if &#40; is_single&#40;&#41; &#41; &#123;
  &#60;link rel=&#34;”stylesheet”&#34; href=&#34;&#38;rdquo;&#38;lt;?php&#34; bloginfo&#40;’template_url’&#41;; ?&#62;/single_style.css” type=”text/css” media=”screen” /&#62;;   
&#60;?php &#125; else &#123; ?&#62;
  &#60;link rel=&#34;”stylesheet”&#34; href=&#34;&#38;rdquo;&#38;lt;?php&#34; bloginfo(’stylesheet_url’); ?&#62;” type=”text/css” media=”screen” /&#62;   
&#60;?php &#125; ?&#62;

以上语句说明了当显示single.php的时候使用single_style.css这个样式表，否则使用sytle.css。
really easy, huh?!
]]></description>
			<content:encoded><![CDATA[<p>大多数主题使用一个统一的样式表: style.css，这并不能满足一些特殊需要，例如linxuabc的首页(index.php)和全文页(single.php)布局就不一样，所以需要实现在不同页面中使用不同的样式表。</p>
<p>
<span id="more-55"></span>
 </p>
<p>&#160; wordpress的动态页面都是通过调用header.php来构造的，而header.php定义了当前页面的样式表，所以解决的思路是判断当前是什么页面，然后根据不同的页面调用不同的样式表。下面是linuxabc中header.php关于css调用的代码</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;”stylesheet”&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&amp;rdquo;&amp;lt;?php&quot;</span> bloginfo<span style="color: #009900;">&#40;</span>’template_url’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/single_style.css” type=”text/css” media=”screen” /&gt;;   
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;link rel=&quot;”stylesheet”&quot; href=&quot;&amp;rdquo;&amp;lt;?php&quot; bloginfo(’stylesheet_url’); ?&gt;” type=”text/css” media=”screen” /&gt;   
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>以上语句说明了当显示single.php的时候使用single_style.css这个样式表，否则使用sytle.css。</p>
<p>really easy, huh?!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/wordpress/using-different-css-on-different-pages.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>live write的妙用（一）</title>
		<link>http://www.linuxabc.net.cn/software/using-live-writer-in-a-smart-way-1.html</link>
		<comments>http://www.linuxabc.net.cn/software/using-live-writer-in-a-smart-way-1.html#comments</comments>
		<pubDate>Mon, 29 Sep 2008 18:25:47 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[软件]]></category>
		<category><![CDATA[live writer]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/software/using-live-writer-in-a-smart-way-1.html/</guid>
		<description><![CDATA[live write每天都在给我惊喜，今天也不例外。
在进入正文之前先骂一下IE6，IE6是一个自以为是的家伙，都是微软这个父母给惯坏的，不遵循w3c的标准，对CSS的支持存在一些问题，在其它浏览器中显示得好好的页面在IE6中就不正常了，本网站的首页就是一个例子。骂归骂，毕竟IE6还是占据了绝大部分的市场，网页设计师不得不考虑它。

巧改英文链接
 永久链接的乱码问题又是IE6的另一个缺陷，linuxabc启用了永久链接，当文章名是中文时，则链接在IE6的浏览器中显示的是乱码（在firefox中显示正常），live write的文章属性中有一个“数据域”，我们可以在这里输入文章的英文链接，例如《live writer 试用手记》这篇文章，alfie就改成了live-writer-try-out-notes，于是该文的永久链接就由乱码变成了http://www.linuxabc.net.cn/wordpress/live-writer-try-out-notes.html，在IE6和firefox均能正常显示该链接。
支持多个blog
alfie也在家里的电脑上架设了一套wordpress测试环境，在将文章发布到互联网前，需要现在测试环境测试一下。live writer提供了管理多个blog的功能，可以在“工具”—“帐户”中新增，发布文章前先确认当前所选定的blog即可。
]]></description>
			<content:encoded><![CDATA[<p>live write每天都在给我惊喜，今天也不例外。</p>
<p>在进入正文之前先骂一下IE6，IE6是一个自以为是的家伙，都是微软这个父母给惯坏的，不遵循w3c的标准，对CSS的支持存在一些问题，在其它浏览器中显示得好好的页面在IE6中就不正常了，本网站的首页就是一个例子。骂归骂，毕竟IE6还是占据了绝大部分的市场，网页设计师不得不考虑它。</p>
<p><span id="more-54"></span></p>
<h4>巧改英文链接</h4>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/livewritersmartway1.gif"><img title="live.writer.smart.way.1" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 0px 0px 5px; border-left: 0px; border-bottom: 0px" height="213" alt="live.writer.smart.way.1" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/livewritersmartway1-thumb.gif" width="204" align="right" border="0" /></a> 永久链接的乱码问题又是IE6的另一个缺陷，linuxabc启用了永久链接，当文章名是中文时，则链接在IE6的浏览器中显示的是乱码（在firefox中显示正常），live write的文章属性中有一个“数据域”，我们可以在这里输入文章的英文链接，例如《live writer 试用手记》这篇文章，alfie就改成了live-writer-try-out-notes，于是该文的永久链接就由乱码变成了<a href="http://www.linuxabc.net.cn/wordpress/live-writer-try-out-notes.html">http://www.linuxabc.net.cn/wordpress/live-writer-try-out-notes.html</a>，在IE6和firefox均能正常显示该链接。</p>
<h4>支持多个blog</h4>
<p>alfie也在家里的电脑上架设了一套wordpress测试环境，在将文章发布到互联网前，需要现在测试环境测试一下。live writer提供了管理多个blog的功能，可以在“工具”—“帐户”中新增，发布文章前先确认当前所选定的blog即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/software/using-live-writer-in-a-smart-way-1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress、windows和永久链接</title>
		<link>http://www.linuxabc.net.cn/wordpress/wordpress-windows-and-permanent-link.html</link>
		<comments>http://www.linuxabc.net.cn/wordpress/wordpress-windows-and-permanent-link.html#comments</comments>
		<pubDate>Mon, 29 Sep 2008 14:06:14 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/wordpress/wordpress-windows-and-permanent-link.html/</guid>
		<description><![CDATA[在blog中发布一篇文章后，wordpress会自动赋予一个post_id，读者访问这篇文章时，通过浏览器的地址栏可以发现其链接形如：http://example.com/?p=N，其中N就是post_id，这样的链接对读者毫无疑义，对搜索引擎也不友好，所以需要更改链接的样式，改成什么样好呢？wordpress提供了几种方式，如下图所示：


 

alfie倾向于使用这种样式：http://www.linuxabc.net.cn/mobile/palm-or-wm.html/，这种链接不深，容易被搜索引擎收录；不带日期，容易迁移；带有分类，容易管理，最后是文章名的英文，容易理解。在“自定义结构”中输入/%category%/%postname%.html/，再点击“保存修改”即可启动永久的自定义链接了。
有些用户在windows下安装了wordpress环境，由于默认情况下apache2 for windows不加载mod_rewrite模块，所以wordpress的自定义永久链接无法正常工作。alfie今晚就被这个折腾了很久，终于找到了解决方案：
一、修改httpd.conf，启用mod_rewrite.so

#将下行前面的#删掉，加载mod_rewrite模块   
LoadModule rewrite_module modules/mod_rewrite.so    
&#160;
# 默认情况下apache2对其根目录设置了 AllowOverride none的权限，    
# 故无法创建和修改.htaccess文件，请增加下列配置    
&#60;Directory &#34;D:/Apache2/htdocs/wordpress&#34;&#62;    
    Options Indexes FollowSymLinks    
    AllowOverride All    
&#60;/Directory&#62;

二、创建.htaccess
当启用永久链接时，wordpress会在其根目录下自动创建.htaccess文件，所以读者不用担心，如果发现没有该文件的话，也可以自己手工创建，内容如下：

# BEGIN WordPress   
&#60;IfModule mod_rewrite.c&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>在blog中发布一篇文章后，wordpress会自动赋予一个post_id，读者访问这篇文章时，通过浏览器的地址栏可以发现其链接形如：<a href="http://example.com/?p=N">http://example.com/?p=N</a>，其中N就是post_id，这样的链接对读者毫无疑义，对搜索引擎也不友好，所以需要更改链接的样式，改成什么样好呢？wordpress提供了几种方式，如下图所示：</p>
<p>
<span id="more-51"></span>
 </p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/permanentlinksettingboard.gif"><img title="permanent.link.setting.board" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="256" alt="permanent.link.setting.board" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/permanentlinksettingboard-thumb.gif" width="354" border="0" /></a></p>
<p>alfie倾向于使用这种样式：<a title="http://www.linuxabc.net.cn/mobile/palm-or-wm%EF%BC%9F.html/" href="http://www.linuxabc.net.cn/mobile/palm-or-wm.html/">http://www.linuxabc.net.cn/mobile/palm-or-wm.html/</a>，这种链接不深，容易被搜索引擎收录；不带日期，容易迁移；带有分类，容易管理，最后是文章名的英文，容易理解。在“自定义结构”中输入/%category%/%postname%.html/，再点击“保存修改”即可启动永久的自定义链接了。</p>
<p>有些用户在windows下安装了wordpress环境，由于默认情况下apache2 for windows不加载mod_rewrite模块，所以wordpress的自定义永久链接无法正常工作。alfie今晚就被这个折腾了很久，终于找到了解决方案：</p>
<h4>一、修改httpd.conf，启用mod_rewrite.so</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#将下行前面的#删掉，加载mod_rewrite模块   </span>
LoadModule rewrite_module modules<span style="color: #000000; font-weight: bold;">/</span>mod_rewrite.so    
&nbsp;
<span style="color: #666666; font-style: italic;"># 默认情况下apache2对其根目录设置了 AllowOverride none的权限，    </span>
<span style="color: #666666; font-style: italic;"># 故无法创建和修改.htaccess文件，请增加下列配置    </span>
<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #ff0000;">&quot;D:/Apache2/htdocs/wordpress&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>    
    Options Indexes FollowSymLinks    
    AllowOverride All    
<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<h4>二、创建.htaccess</h4>
<p>当启用永久链接时，wordpress会在其根目录下自动创建.htaccess文件，所以读者不用担心，如果发现没有该文件的话，也可以自己手工创建，内容如下：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># BEGIN WordPress   </span>
<span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_rewrite.c<span style="color: #000000; font-weight: bold;">&gt;</span>  
   RewriteEngine On   
   RewriteBase <span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>   
   RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REQUEST_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>-f   
   RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REQUEST_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>-d   
   RewriteRule . <span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>index.php <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>   
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #666666; font-style: italic;"># END WordPress</span></pre></div></div>

<p>最后在重启apache服务就可以在windows下启用永久链接了。</p>
<p>另外需要提醒大家的是尽早在安装测试环境后马上进行上述的修改，链接样式变更后，搜索引擎所收录的旧链接将失效，读者访问你的文章时将得到404错误。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/wordpress/wordpress-windows-and-permanent-link.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>live writer试用手记</title>
		<link>http://www.linuxabc.net.cn/software/live-writer-try-out-notes.html</link>
		<comments>http://www.linuxabc.net.cn/software/live-writer-try-out-notes.html#comments</comments>
		<pubDate>Sat, 27 Sep 2008 18:45:17 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[软件]]></category>
		<category><![CDATA[live writer]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/software/live-writer%e8%af%95%e7%94%a8%e6%89%8b%e8%ae%b0.html/</guid>
		<description><![CDATA[wordpress堪称完美之作，但有一点令我耿耿于怀，那就是孱弱的文章编辑功能：

1. visual edit名不副实，在后台攥写文章发布后却不是那么一回事； 
2. 速度慢，wordpress的后台那叫一个慢啊，点个按钮得等个3、5秒； 

于是，把目光投向离线编辑器，试用了几个发现最好用的还是微软出的live writer   令我诧异的是，这么优秀的软件，居然是免费的，向来唯利是图的M$，居然提供了一顿丰盛的免费的午餐！

不过我爱上live writer的历程却并不轻松，安装过程颇费周折。live writer没有独立的安装程序，需要WLInstall.exe这个引导程序通过网络进行安装（注意：live writer依赖于.net framework 2.0，用户需要先装这个组件），WLInstall.exe实际上是微软live计划的入口，运行后将检测你机器上的live组件，并默认安装/更新所有组件，真霸道！说到这alife又忍不住想f*ck微软了，不过转念一想，我们在吃免费的午餐，还有什么资格对人家口诛笔伐呢？说到这就不得不说国内用户的丑恶嘴脸，一方面在用盗版的windows，一方面又骂微软定价过高、安全性差，是，没错，windows的售价大大超出了国民的支付能力，但你可以不用啊？微软又没有把刀架在你脖子上，所以既然偷偷的用了别人的东西，就是不要再抱怨这抱怨那了，知足吧。扯远了，安装的过程就不多说了，为了方便读者，alfie将live writer的安装目录压缩了，放在这里供大家下载，解压后就可直接运行，再提醒一次，需要先安装.net framework 2.0哦。

live writer的功能介绍
一、界面
live writer继承了典型的微软风格，类似office，很容易上手

二、真正的所见即所得
这是微软的强项，无出其右者，可能有的读者会反对，觉得Tex才是真正的WYSWYG，这就不深究了，对于普通用户而言，唯M$是也。在live writer安装的过程中，它将自动检测blog类型，并将blog模板下载到本地，这样用户就可以边编辑边查看在网站中的效果了。
三、贴心的图片编辑功能
这是alfie的最爱了，用户不仅可以在live writer中调整图片大小、变形、旋转的基本操作，还可以增加各种效果，例如上图就用了阴影效果，最贴心的当属水印，用户可以在图片中写上自己博客的网址，防止文章被盗用，这也是一种维权的手段之一，真的是太贴心了，alfie在用到这个功能的时候有一种很温暖的感觉，^_^。
四、智能发布
用户发表一篇文章后，觉得不满意，再修改再发布，仍然可以覆盖原先发布的文章，甚至更改了文章标题也不妨，不知道这是无心插柳还是有意为之。如果是有意为之，则微软的体贴到了极致；如果这无心插柳，则这个bug显得那么可爱，alife要的就是这种效果。
live writer还有插件接口，将来肯定会有越来越多的插件丰富其功能，对于拥有blog的用户，live writer绝对是不容放过的一道美食。
]]></description>
			<content:encoded><![CDATA[<p>wordpress堪称完美之作，但有一点令我耿耿于怀，那就是孱弱的文章编辑功能：</p>
<ol>
<li><span style="color: #0080c0">1. visual edit名不副实，在后台攥写文章发布后却不是那么一回事； </span></li>
<li><span style="color: #0080c0">2. 速度慢，wordpress的后台那叫一个慢啊，点个按钮得等个3、5秒；</span> </li>
</ol>
<p>于是，把目光投向离线编辑器，试用了几个发现最好用的还是微软出的live writer   <br /><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/windows-live-writer-logo-with-bg1.gif"><img title="Windows_Live_Writer_logo_with_bg" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="120" alt="Windows_Live_Writer_logo_with_bg" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/windows-live-writer-logo-with-bg-thumb1.gif" width="120" align="left" border="0" /></a>令我诧异的是，这么优秀的软件，居然是免费的，向来唯利是图的M$，居然提供了一顿丰盛的免费的午餐！</p>
<p><span id="more-46"></span><br />
不过我爱上live writer的历程却并不轻松，安装过程颇费周折。live writer没有独立的安装程序，需要<a title="live writer下载地址" href="http://g.live.com/1rewlive/zh-cn/WLInstaller.exe" target="_blank">WLInstall.exe</a>这个引导程序通过网络进行安装（注意：live writer依赖于<a title=".net framework 2.0下载地址" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=zh-cn" target="_blank">.net framework 2.0</a>，用户需要先装这个组件），<a title="live writer下载地址" href="http://g.live.com/1rewlive/zh-cn/WLInstaller.exe" target="_blank">WLInstall.exe</a>实际上是微软live计划的入口，运行后将检测你机器上的live组件，并默认安装/更新所有组件，真霸道！说到这alife又忍不住想f*ck微软了，不过转念一想，我们在吃免费的午餐，还有什么资格对人家口诛笔伐呢？说到这就不得不说国内用户的丑恶嘴脸，一方面在用盗版的windows，一方面又骂微软定价过高、安全性差，是，没错，windows的售价大大超出了国民的支付能力，但你可以不用啊？微软又没有把刀架在你脖子上，所以既然偷偷的用了别人的东西，就是不要再抱怨这抱怨那了，知足吧。扯远了，安装的过程就不多说了，为了方便读者，alfie将live writer的安装目录压缩了，放在<a title="live Writer(ver.14.0.5025.904).rar" href="http://www.namipan.com/d/7417c4b0b0696b935dc62e208b2ee015cfe1aefca6d14700" target="_blank">这里</a>供大家下载，解压后就可直接运行，再提醒一次，需要先安装<a title=".net framework 2.0下载地址" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=zh-cn" target="_blank">.net framework 2.0</a>哦。
</p>
<p>live writer的功能介绍</p>
<h4>一、界面</h4>
<p>live writer继承了典型的微软风格，类似office，很容易上手</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/lwpreview.gif"><img title="lw.preview" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="135" alt="lw.preview" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/lwpreview-thumb.gif" width="204" border="0" /></a></p>
<h4>二、真正的所见即所得</h4>
<p>这是微软的强项，无出其右者，可能有的读者会反对，觉得Tex才是真正的WYSWYG，这就不深究了，对于普通用户而言，唯M$是也。在live writer安装的过程中，它将自动检测blog类型，并将blog模板下载到本地，这样用户就可以边编辑边查看在网站中的效果了。</p>
<h4>三、贴心的图片编辑功能</h4>
<p>这是alfie的最爱了，用户不仅可以在live writer中调整图片大小、变形、旋转的基本操作，还可以增加各种效果，例如上图就用了阴影效果，最贴心的当属水印，用户可以在图片中写上自己博客的网址，防止文章被盗用，这也是一种维权的手段之一，真的是太贴心了，alfie在用到这个功能的时候有一种很温暖的感觉，^_^。</p>
<h4>四、智能发布</h4>
<p>用户发表一篇文章后，觉得不满意，再修改再发布，仍然可以覆盖原先发布的文章，甚至更改了文章标题也不妨，不知道这是无心插柳还是有意为之。如果是有意为之，则微软的体贴到了极致；如果这无心插柳，则这个bug显得那么可爱，alife要的就是这种效果。</p>
<p>live writer还有插件接口，将来肯定会有越来越多的插件丰富其功能，对于拥有blog的用户，live writer绝对是不容放过的一道美食。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/software/live-writer-try-out-notes.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>易用性和灵活性的完美结合：wordpress</title>
		<link>http://www.linuxabc.net.cn/wordpress/wordpress%e3%80%81%e6%89%a9%e5%b1%95%e6%80%a7%e5%92%8c%e4%ba%a7%e5%93%81%e8%ae%be%e8%ae%a1.html</link>
		<comments>http://www.linuxabc.net.cn/wordpress/wordpress%e3%80%81%e6%89%a9%e5%b1%95%e6%80%a7%e5%92%8c%e4%ba%a7%e5%93%81%e8%ae%be%e8%ae%a1.html#comments</comments>
		<pubDate>Sat, 27 Sep 2008 09:18:00 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/uncategorized/wordpress%e3%80%81%e6%89%a9%e5%b1%95%e6%80%a7%e5%92%8c%e4%ba%a7%e5%93%81%e8%ae%be%e8%ae%a1.html/</guid>
		<description><![CDATA[wordpress简单以用，扩展性强，是风靡全世界的原因]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/wordpresslogo1.png"><img title="wordpress.logo" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 0px 5px; border-left: 0px; border-bottom: 0px" height="153" alt="wordpress.logo" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/wordpresslogo-thumb1.png" width="184" align="right" border="0" /></a> 当初选用wordpress纯属偶然，就是觉得用的人多，遇到问题容易找到答案，后来在使用的过程中不知不觉就迷上了它，令我着迷的是它的扩展性很强。</p>
<p>wordpress采用的是php，简单易学，官方甚至提出5分钟安装好一个博客的口号。整个软件的架构设计得很好，有大量的第三方插件，从天气预报到youTube视频，不一而足，这些种类繁多的插件为能满足各种各样的用户需求，不过我觉得最吸引用户的是互联网上有大量的精美的主题。</p>
<p><span id="more-29"></span></p>
<p>得益于php和优秀的架构，即使菜鸟也能对主题动刀动枪大改一番，就像乐高积木一样，我们仿佛回到了童年，将颜色各异的积木组合成各种个样的形状，那种内心的满足是其他blog软件所无法提供的，这就是DIY的乐趣和魅力所在。使用了wordpress的blog，大都会开一个theme的类别，可见DIY情怀是如此的流行，我承认我已经喜欢上修改主题了，虽然这跟建博的初衷背道而驰，不过我还是会继续对它进行修葺，就像装修一栋属于自己的房子一样。下面是国人根据K2这个主题进行修改后的k2-u3主题</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/k2orig1.gif"><img title="k2.orig" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 10px 0px 0px; border-left: 0px; border-bottom: 0px" height="216" alt="k2.orig" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/k2orig-thumb1.gif" width="235" border="0" /></a>&#160; <a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/k2u31.png"><img title="k2-u3" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 0px 0px 10px; border-left: 0px; border-bottom: 0px" height="259" alt="k2-u3" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/09/k2u3-thumb1.png" width="179" border="0" /></a> </p>
<p>这种DIY情怀不禁让我想起了windows和linux，windows是一个纯粹的商业软件，微软以用户易用性为中心，打造了市场占有率最大的操作系统，它吸引用户的是其易用性和绚丽的图形界面，安装简单，易于使用，大量的应用软件可供选择，不过高端用户总觉得缺少了一些东西，那就是windows屏蔽了系统底层的东西，无法满足他们DIY的乐趣，恰好，linux弥补了这个空白，linux是一个个人兴趣爱好的产物，在各路好手的援手下慢慢成长起来的，它最大的特点就是灵活性高，用户能随心所欲对其进行修剪，这能很好的满足那些拥有无穷精力、喜欢折腾的DIY们的需要。</p>
<p>网上不少windows vs linux的帖子都会谈到windows的易用性和linux的灵活性，微软近年来也开始将操作系统底层的东西展现给用户，譬如vista提供了一个大幅改进了的命令行环境，而linux厂商也在易用性方面下了很大功夫，ubuntu和SuSE就是代表，所以说，一个产品既要考虑大众用户对简单易用的需求，又要考虑高端用户对扩展性的需求。</p>
<p>wordpress正是这样的一个产品，它是易用性和灵活性的完美结合，这就是它风靡全世界的原因。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/wordpress/wordpress%e3%80%81%e6%89%a9%e5%b1%95%e6%80%a7%e5%92%8c%e4%ba%a7%e5%93%81%e8%ae%be%e8%ae%a1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何在wordpress中置顶精华文章？</title>
		<link>http://www.linuxabc.net.cn/wordpress/how-to-highlight-your-selection-posts.html</link>
		<comments>http://www.linuxabc.net.cn/wordpress/how-to-highlight-your-selection-posts.html#comments</comments>
		<pubDate>Tue, 23 Sep 2008 10:20:22 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/wordpress/%e5%a6%82%e4%bd%95%e5%9c%a8wordpress%e4%b8%ad%e7%bd%ae%e9%a1%b6%e7%b2%be%e5%8d%8e%e6%96%87%e7%ab%a0%ef%bc%9f.html/</guid>
		<description><![CDATA[很多博主有这样的烦恼，一些精华文章随着时间流逝而慢慢沉底，那在wordpress中如何将这些精华文章置顶呢，就像论坛的置顶文章一样？答案是肯定的，一种方法是通过WP-sticky这个插件，不过功能有限，仅能对一篇文章进行置顶，我们不做深究；另一种方法就是手工调整源代码了，在页面中增加“精华文章区块”，废话少说，先来看看效果图：  

这个截图来自于http://www.geekishblog.com/，博主用的是Organic这个主题，该主题的sidebar.php里有一个包含两个标签页的区块，第一个标签页的内容是Recent Post，第二个是Recent Comments，接着再通过样式表和tabber.js这个类来实现ajax的效果，那我们也可以利用它做一个“精华文章区块”来放置精华文章。先下载tabber.js
一、解压到主题根目录下
压缩包里面有多个示例文件和两个js文件，还有一个样式表，将tabber-minimized.js和exmaple.css解压到主题的根目录下，并重新命名为tabber.js和tabber.css。
说明：两个javascript文件的内容完全一样，tabber-minimized.js是tabber.js的优化版本，文件尺寸小，能加速网页的浏览速度。另外，这是一个遵循GPL的自由软件，用户可以免费使用。
二、修改header.php
标签页的效果是利用无序列表+CSS+javascript来实现的，因而在header.php中指定这两个文件的URL。

&#60;link media=&#34;screen&#34; href=&#34;&#38;lt;?php echo bloginfo(stylesheet_directory). '/tabber.css'; ?&#38;gt;&#34; type=&#34;text/css&#34; rel=&#34;stylesheet&#34; /&#62; 
&#60;script type=&#34;text/javascript&#34; src=&#34;&#38;lt;?php echo bloginfo(stylesheet_directory) .'/tabber.js'; ?&#38;gt;&#34;&#62;&#60;/script&#62;

bloginfo是wordpress的函数，stylesheet_directory是bloginfo的参数，整个语句的意思是构造tabber.js的绝对路径，这样用户的浏览器就可以正确的下载该文件了。最后加上这段：

&#60;script type=&#34;text/javascript&#34;&#62;
   document.write('&#60;style type=&#34;text/css&#34;&#62;.tabber{display:none;}&#60;\/style&#62;'); 
&#60;/script&#62;

默认情况下浏览器会在tabber类加载前优先显示标签页的内容，这会影响影响用户的体验，这段代码的作用是保证tabbe类加载之后方显示“精华文章区块”。
三、确定“精华文章区块”位置
在网页的哪个位置放置“精华文章区块”呢？这个问题还蛮挺重要的，很多主题都将类似的功能区块放在右边栏，因为这样有利于用户导航，而本网站使用的是ProSense这个主题，侧边栏的位置大小有限，所以把它放在第一和第二篇文章之间，这样也能醒目展示“精华文章”。
下面是ProSense主题中index.php的源代码：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
&#60;?php if &#40;have_posts&#40;&#41;&#41; : ?&#62; 
   &#60;?php $count = 1 ?&#62;
   &#60;?php while &#40;have_posts&#40;&#41;&#41; : the_post&#40;&#41;; ?&#62; 
      &#60;div class=&#34;post&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>很多博主有这样的烦恼，一些精华文章随着时间流逝而慢慢沉底，那在wordpress中如何将这些精华文章置顶呢，就像论坛的置顶文章一样？答案是肯定的，一种方法是通过WP-sticky这个插件，不过功能有限，仅能对一篇文章进行置顶，我们不做深究；另一种方法就是手工调整源代码了，在页面中增加“精华文章区块”，废话少说，先来看看效果图： <a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/tabbersample1.jpg"><img title="tabber.sample" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="159" alt="tabber.sample" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/tabbersample-thumb1.jpg" width="244" border="0" /></a> </p>
<p><span id="more-26"></span></p>
<p>这个截图来自于<a href="http://www.geekishblog.com/">http://www.geekishblog.com/</a>，博主用的是Organic这个主题，该主题的sidebar.php里有一个包含两个标签页的区块，第一个标签页的内容是Recent Post，第二个是Recent Comments，接着再通过样式表和tabber.js这个类来实现ajax的效果，那我们也可以利用它做一个“精华文章区块”来放置精华文章。先下载<a href="http://www.barelyfitz.com/projects/tabber/tabber.zip" target="_blank">tabber.js</a></p>
<h4>一、解压到主题根目录下</h4>
<p>压缩包里面有多个示例文件和两个js文件，还有一个样式表，将tabber-minimized.js和exmaple.css解压到主题的根目录下，并重新命名为tabber.js和tabber.css。</p>
<p>说明：两个javascript文件的内容完全一样，tabber-minimized.js是tabber.js的优化版本，文件尺寸小，能加速网页的浏览速度。另外，这是一个遵循GPL的自由软件，用户可以免费使用。</p>
<h4>二、修改header.php</h4>
<p>标签页的效果是利用无序列表+CSS+javascript来实现的，因而在header.php中指定这两个文件的URL。</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link media=&quot;screen&quot; href=&quot;&amp;lt;?php echo bloginfo(stylesheet_directory). '/tabber.css'; ?&amp;gt;&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt; 
&lt;script type=&quot;text/javascript&quot; src=&quot;&amp;lt;?php echo bloginfo(stylesheet_directory) .'/tabber.js'; ?&amp;gt;&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>bloginfo是wordpress的函数，stylesheet_directory是bloginfo的参数，整个语句的意思是构造tabber.js的绝对路径，这样用户的浏览器就可以正确的下载该文件了。最后加上这段：</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot;&gt;
   document.write('&lt;style type=&quot;text/css&quot;&gt;.tabber{display:none;}&lt;\/style&gt;'); 
&lt;/script&gt;</pre></div></div>

<p>默认情况下浏览器会在tabber类加载前优先显示标签页的内容，这会影响影响用户的体验，这段代码的作用是保证tabbe类加载之后方显示“精华文章区块”。</p>
<h4>三、确定“精华文章区块”位置</h4>
<p>在网页的哪个位置放置“精华文章区块”呢？这个问题还蛮挺重要的，很多主题都将类似的功能区块放在右边栏，因为这样有利于用户导航，而本网站使用的是ProSense这个主题，侧边栏的位置大小有限，所以把它放在第一和第二篇文章之间，这样也能醒目展示“精华文章”。</p>
<p>下面是ProSense主题中index.php的源代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
   <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
   <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
      &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt; 
         显示文章 
      &lt;/div&gt;&lt;!-- post end--&gt; 
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span> 
         &lt;div&gt;
            精华文章区块 
         &lt;/div&gt;&lt;!--在第一篇文章之后显示“精华文章区块” --&gt; 
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
   <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
   &lt;div class=&quot;navigation&quot;&gt; 
      显示导航链接 
   &lt;/div&gt; 
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
   显示目前无文章 
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>整段代码的意思是：如数据库有文章则使用while……endwhile这个循环将所有文章显示出来，加入计数器count，当count=1时插入“精华文章区块”（亦即第一篇文章之后）。关键语句就是跟计数器相关的两句：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
...
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 显示精华文章区块 <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>依葫芦画瓢，只要将这两句加入到您到index.php就可以了，切记将第一句放在while之前，第二句放在while和endwhile之间。</p>
<h4>四、添加精华文章</h4>
<p>alfie的精华文章内容如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;tabber&quot;&gt;
  &lt;div class=&quot;tabbertab&quot;&gt;
     &lt;h2&gt;最新文章&lt;/h2&gt;
      &lt;ul&gt;
        &lt;?php
          $recentposts = new WP_query();
          $recentposts-&gt;query('showposts=5&amp;amp;orderby=date&amp;amp;order=DESC');
        ?&gt;
        &lt;?php while ($recentposts-&gt;have_posts()) : $recentposts-&gt;the_post(); ?&gt;
          &lt;li&gt;
              &lt;a href=&quot;&amp;lt;?php the_permalink() ?&amp;gt;&quot;&gt;&lt;?php the_title() ?&gt;&lt;/a&gt;
              &lt;span&gt;&lt;?php if(function_exists('the_views')) { the_views(); } ?&gt; | &lt;?php comments_popup_link('发表评论', '1 条评论?', '% 条评论?'); ?&gt; | &lt;?php the_time('Y-m-d') ?&gt;&lt;/span&gt;
&nbsp;
        &lt;?php endwhile; ?&gt;
      &lt;/li&gt;&lt;/ul&gt;
  &lt;/div&gt;
  &lt;div class=&quot;tabbertab&quot;&gt;
     &lt;h2&gt;精品推荐&lt;/h2&gt;
     &lt;ul&gt;
      &lt;li&gt;该功能未完工，请耐心等候。
    &lt;/li&gt;&lt;/ul&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>为了方便日后的维护，alfie将这部分内容单独放入一个文件(suggestions.php)，index.php里只需要简单的include它就可以了。于是在index.php中:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'suggestions.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>五、修改样式表</h4>
<p>对应的样式表是tabber.css，读者需要自行修改之，以使该区块能跟整个网页的风格相协调。<a href="http://www.linuxabc.net.cn">www.linuxabc.net.cn</a>的tabber.css如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">----clip---- 
<span style="color: #808080; font-style: italic;">/*-------------------------------------------------- 
ul.tabbernav = the tab navigation list 
li.tabberactive = the active tab 
--------------------------------------------------*/</span> 
ul<span style="color: #6666ff;">.tabbernav</span> <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#663200</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span> <span style="color: #933;">14px</span> Verdana<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
ul<span style="color: #6666ff;">.tabbernav</span> li <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
ul<span style="color: #6666ff;">.tabbernav</span> li a <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">0.5em</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#663200</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FBF5DF</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
ul<span style="color: #6666ff;">.tabbernav</span> li a<span style="color: #3333ff;">:link </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CC3300</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span> 
ul<span style="color: #6666ff;">.tabbernav</span> li a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#663320</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span> 
&nbsp;
ul<span style="color: #6666ff;">.tabbernav</span> li a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CC3300</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#EDE0B3</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#663200</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
ul<span style="color: #6666ff;">.tabbernav</span> li<span style="color: #6666ff;">.tabberactive</span> a <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#EDE0B3</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#EDE0B3</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
ul<span style="color: #6666ff;">.tabbernav</span> li<span style="color: #6666ff;">.tabberactive</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CC3300</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> EDE0B3<span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc66cc;">663200</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">/*-------------------------------------------------- 
.tabbertab = the tab content 
Add style only after the tabber interface is set up (.tabberlive) 
--------------------------------------------------*/</span> 
<span style="color: #6666ff;">.tabberlive</span> <span style="color: #6666ff;">.tabbertab</span> <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#663200</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#EDE0B3</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #6666ff;">.tabberlive</span> <span style="color: #6666ff;">.tabbertab</span> ul li <span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CC3300</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#bbb</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/star.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.4em</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #6666ff;">.tabberlive</span> <span style="color: #6666ff;">.tabbertab</span> ul li span<span style="color: #00AA00;">&#123;</span> 
   <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> 
   <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#663200</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
----clip----</pre></td></tr></table></div>

<p>至此大功告成，说明：alife的美工实在不怎么样，所以漂亮与否就全靠读者自己的艺术鉴赏力和美工技巧了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/wordpress/how-to-highlight-your-selection-posts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
