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

<channel>
	<title>漫步 &#187; wordpress tips</title>
	<atom:link href="http://roamlog.info/tag/wordpress-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://roamlog.info</link>
	<description>WordPress, Design, Web2.0, Software, IT, News</description>
	<lastBuildDate>Thu, 29 Dec 2011 11:05:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPress 小技巧: 给文章增加有效期功能</title>
		<link>http://roamlog.info/archives/set-post-expiration-datetime.html</link>
		<comments>http://roamlog.info/archives/set-post-expiration-datetime.html#comments</comments>
		<pubDate>Thu, 23 Oct 2008 22:28:25 +0000</pubDate>
		<dc:creator>漫步</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://roamlog.cn/?p=588</guid>
		<description><![CDATA[如果可以给文章设定一个有效期，在达到有效期后自动隐藏，这个功能可能有部分 WordPrses 爱好者需要吧。不过 WordPress 默认没有这个功能，今天在网上乱逛的时候偶然发现了一篇给文章增加有效期的文章，他是利用 WordPress 的custom field（自定义字段）的功能实现的。
实现方法需要修改你的主题文件，代码如下（注意：下面的代码为原文代码，只做参考用）：


&#60;?php
if &#40;have_posts&#40;&#41;&#41; :
     while &#40;have_posts&#40;&#41;&#41; : the_post&#40;&#41;; ?&#62;
         // 获取以 expiration 为 key 的 custom field 的值
         $expirationtime = get_post_custom_values('expiration');
         [...]]]></description>
			<content:encoded><![CDATA[<p>如果可以给文章设定一个有效期，在达到有效期后自动隐藏，这个功能可能有部分 WordPrses 爱好者需要吧。不过 WordPress 默认没有这个功能，今天在网上乱逛的时候偶然发现了一篇给文章增加有效期的<a href="http://www.wprecipes.com/how-to-set-post-expiration-datetime-on-your-wordpress-blog">文章</a>，他是利用 WordPress 的<code>custom field</code>（自定义字段）的功能实现的。</p>
<p>实现方法需要修改你的主题文件，代码如下（注意：下面的代码为原文代码，只做参考用）：<br />
<span id="more-588"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
     <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
         // 获取以 expiration 为 key 的 custom field 的值
         $expirationtime = get_post_custom_values('expiration');
         if (is_array($expirationtime)) {
             // 把数组元素组合为字符串
             $expirestring = implode($expirationtime);
         }
         // 比较时间
         $secondsbetween = strtotime($expirestring)-time();
         if ( $secondsbetween &gt; 0 ) {
             // For exemple...
             the_title();
             the_excerpt();
         }
     endwhile;
endif;
?&gt;</pre></div></div>

<p>使用<code>get_post_custom_values</code>函数获取你在写日志时定义的以<code>expiration</code>为 key 的<code>custom field</code>的值，进行一定的格式化动作后和现在的时间进行比较，如果大于现在的时间，说明文章有效期还未到，则显示这篇日志。</p>
<p>需要注意的是，在写日志的时候，记得填写 custom field， key 为 expiration （和上面代码中的 expiration 相对应），value 为<code>mm/dd/yyyy</code>格式的时间，如<code>10/28/2008</code> 。</p>
<p>也许有人看了代码也不甚清楚，我就拿默认主题之一 default 作实例吧。修改<code>index.php</code>文件，下面是修改后的代码。</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: #009933; font-style: italic;">/**
 * @package WordPress
 * @subpackage Default_Theme
 */</span>
&nbsp;
get_header<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>
&nbsp;
	&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt;
&nbsp;
	<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>
&nbsp;
		<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>
		<span style="color: #000000; font-weight: bold;">&lt;?php</span>  
		<span style="color: #000088;">$expirationtime</span> <span style="color: #339933;">=</span> get_post_custom_values<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'expiration'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$expirationtime</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 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;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title_attribute<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;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
				&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F jS, Y'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;!-- by <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> --&gt;&lt;/small&gt;
&nbsp;
				&lt;div class=&quot;entry&quot;&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/div&gt;
&nbsp;
				&lt;p class=&quot;postmetadata&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Tags: '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
Posted in <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> | <span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Edit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' | '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>  <span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_popup_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Comments &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1 Comment &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% Comments &amp;#187;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
			&lt;/div&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: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$expirationtime</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
             <span style="color: #000088;">$expirestring</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$expirationtime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
&nbsp;
         <span style="color: #000088;">$secondsbetween</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$expirestring</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$secondsbetween</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         	 <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;div <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 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;h2&gt;
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title_attribute<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;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
				&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F jS, Y'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;!-- by <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> --&gt;&lt;/small&gt;
&nbsp;
				&lt;div class=&quot;entry&quot;&gt;
					<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/div&gt;
&nbsp;
				&lt;p class=&quot;postmetadata&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Tags: '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
Posted in <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> | <span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Edit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' | '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>  <span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_popup_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Comments &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1 Comment &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% Comments &amp;#187;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
			&lt;/div&gt;
		 <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</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>
&nbsp;
		&lt;div class=&quot;navigation&quot;&gt;
			&lt;div class=&quot;alignleft&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> next_posts_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;laquo; Older Entries'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
			&lt;div class=&quot;alignright&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_posts_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Newer Entries &amp;raquo;'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
		&lt;/div&gt;
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
		&lt;h2 class=&quot;center&quot;&gt;Not Found&lt;/h2&gt;
		&lt;p class=&quot;center&quot;&gt;Sorry, but you are looking for something that isn't here.&lt;/p&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_search_form<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>
	<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>
	&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<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>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>文中肯定会有哪里有纰漏，请见谅，据说我不懂 php， <img src='http://roamlog.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>最后延伸一点，利用<code>get_post_custom_values</code>这个函数可以实现很多自定义显示方式，大家在制作主题时也许可以考虑一下 <img src='http://roamlog.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  。</p>
<img src="http://roamlog.info/?ak_action=api_record_view&id=588&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://roamlog.info/archives/set-post-expiration-datetime.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>wordpress 小技巧:和 &#8220;more&#8221; 做游戏</title>
		<link>http://roamlog.info/archives/play-with-more.html</link>
		<comments>http://roamlog.info/archives/play-with-more.html#comments</comments>
		<pubDate>Tue, 18 Sep 2007 14:50:33 +0000</pubDate>
		<dc:creator>漫步</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://roamlog.cn/index.php/2007/09/18/play-with-more/</guid>
		<description><![CDATA[在阅读本篇 blog 前不妨先读一读漫步写的一篇  你是怎么看 &#8220;click here&#8221; 的 ，这是一个和 &#8220;more&#8221; 或叫 &#8220;click here” 有关的话题，此篇 blog 将继续讨论这个话题。
在使用 &#8220;more&#8221; 这个功能对文章进行分割时，一般在 blog 页面上会默认显示 &#8220;click here&#8221; &#8220;read more&#8221; &#8220;继续阅读&#8221; 等类似的这样的链接式的提示语提示读书继续阅读，而漫步的 blog 则定义为显示 &#8220;Click to continue&#8221; 这种短语,但是如果要修改使用其它语句显示，就需要修改相应模版了。
修改模版再怎么说来也是一个比较麻烦的事情，漫步也不太喜欢随便去修改模版，但漫步今天要讲一个不需要修改模版，也不使用任何插件，轻松自定义 &#8220;more&#8221; 显示的方法，这是一个偶然的机会发现的，其实非常简单。
举个例子，使用工具栏上的 &#8220;more&#8221; 按钮，会自动加入以下代码：

< !--more-->

这样就可以对文章进行分割了，你在哪行加入此代码，从此行开始往后的内容就自动隐藏了。那要怎么样才可以随意自定义 &#8220;more&#8221; 显示呢，

< !--more 和more玩游戏-->

看，就这么简单，直接在 more 后面添加你想使用的语句，另注明，此功能只在 wordpress 2.1 及 其后版本中有效，并确保在 more 和你自定义显示的语句中间有一个空格。
显示示范

]]></description>
			<content:encoded><![CDATA[<p>在阅读本篇 blog 前不妨先读一读漫步写的一篇 <a href="http://roamlog.cn/index.php/2007/09/18/click-here/"> 你是怎么看 &#8220;click here&#8221; 的 </a>，这是一个和 &#8220;more&#8221; 或叫 &#8220;click here” 有关的话题，此篇 blog 将继续讨论这个话题。</p>
<p>在使用 &#8220;more&#8221; 这个功能对文章进行分割时，一般在 blog 页面上会默认显示 &#8220;click here&#8221; &#8220;read more&#8221; &#8220;继续阅读&#8221; 等类似的这样的链接式的提示语提示读书继续阅读，而漫步的 blog 则定义为显示 &#8220;Click to continue&#8221; 这种短语,但是如果要修改使用其它语句显示，就需要修改相应模版了。</p>
<p>修改模版再怎么说来也是一个比较麻烦的事情，漫步也不太喜欢随便去修改模版，但漫步今天要讲一个不需要修改模版，也不使用任何插件，轻松自定义 &#8220;more&#8221; 显示的方法，这是一个偶然的机会发现的，其实非常简单。</p>
<p>举个例子，使用工具栏上的 &#8220;more&#8221; 按钮，会自动加入以下代码：</p>
<blockquote><p>
< !--more-->
</p></blockquote>
<p>这样就可以对文章进行分割了，你在哪行加入此代码，从此行开始往后的内容就自动隐藏了。那要怎么样才可以随意自定义 &#8220;more&#8221; 显示呢，</p>
<blockquote><p>
< !--more 和more玩游戏-->
</p></blockquote>
<p>看，就这么简单，直接在 more 后面添加你想使用的语句，<strong>另注明，此功能只在 wordpress 2.1 及 其后版本中有效，并确保在 more 和你自定义显示的语句中间有一个空格</strong>。</p>
<p><strong>显示示范</strong><br />
<span id="more-117"></span></p>
<img src="http://roamlog.info/?ak_action=api_record_view&id=117&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://roamlog.info/archives/play-with-more.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>你是怎么看 &#8220;click here&#8221; 的</title>
		<link>http://roamlog.info/archives/click-here.html</link>
		<comments>http://roamlog.info/archives/click-here.html#comments</comments>
		<pubDate>Tue, 18 Sep 2007 02:18:51 +0000</pubDate>
		<dc:creator>漫步</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://roamlog.cn/index.php/2007/09/18/click-here/</guid>
		<description><![CDATA[最近在网上看到一场关于 “Click Here” 的讨论，原文在此，这是一个很有意思的话题，也是很有必要讨论一下的话题。
“Click Here”，顾名思义，点击这里的意思，提示读者点击继续阅读。
众所周知，如果一篇文章太长，一般都会使用 more 标签把文章进行分割，使得在首页上只显示部分内容，这样有助于整个首页的排版和显示，所以使用 more 标签是有必要的，与此同时，就带来了另一个问题，那就是 &#8220;click here&#8221; 的问题了，那这种表现形式好不好呢？
漫步 个人认为不太好，参与 此文 讨论的朋友们也大致认可这个观点，&#8221;click here&#8221; 含混不清，不能明确表达出提示读书继续阅读的想法，而且混淆视听，让读者不清楚这个连接到底是做什么的，不清楚点下去后会出现什么，是不是广告呢？所以 漫步 认为有必要使用一个更为明确的描述语句。
一般的可用于替换 “click here” 的描述语句有很多，大致有这些：

Click to continue
Continue Reading
Continue to article
Read more
Click here to access this article

对应的中文版本有：

继续
继续阅读

漫步 个人倾向于使用前两个，Click to continue ，Continue Reading这两个，中文版的当然是会选择 继续阅读 了，这样就更会明确的，让读者一目了然的知晓这是继续阅读的连接了。
那你的观点是什么呢？不妨参与讨论，提出你的观点和意见，欢迎反馈
]]></description>
			<content:encoded><![CDATA[<p>最近在网上看到一场关于 “Click Here” 的讨论，<a href="http://www.copyblogger.com/click-here/">原文在此</a>，这是一个很有意思的话题，也是很有必要讨论一下的话题。</p>
<p>“Click Here”，顾名思义，点击这里的意思，提示读者点击继续阅读。</p>
<p>众所周知，如果一篇文章太长，一般都会使用 <strong>more</strong> 标签把文章进行分割，使得在首页上只显示部分内容，这样有助于整个首页的排版和显示，所以使用 more 标签是有必要的，与此同时，就带来了另一个问题，那就是 &#8220;click here&#8221; 的问题了，那这种表现形式好不好呢？</p>
<p>漫步 个人认为不太好，参与 <a href="http://www.copyblogger.com/click-here">此文</a> 讨论的朋友们也大致认可这个观点，&#8221;click here&#8221; 含混不清，不能明确表达出提示读书继续阅读的想法，而且混淆视听，让读者不清楚这个连接到底是做什么的，不清楚点下去后会出现什么，是不是广告呢？所以 漫步 认为有必要使用一个更为明确的描述语句。</p>
<p>一般的可用于替换 “click here” 的描述语句有很多，大致有这些：</p>
<ol>
<li>Click to continue</li>
<li>Continue Reading</li>
<li>Continue to article</li>
<li>Read more</li>
<li>Click here to access this article</li>
</ol>
<p>对应的中文版本有：</p>
<ol>
<li>继续</li>
<li>继续阅读</li>
</ol>
<p>漫步 个人倾向于使用前两个，<strong>Click to continue</strong> ，<strong>Continue Reading</strong>这两个，中文版的当然是会选择 <strong>继续阅读</strong> 了，这样就更会明确的，让读者一目了然的知晓这是继续阅读的连接了。</p>
<p>那你的观点是什么呢？不妨参与讨论，提出你的观点和意见，欢迎反馈</p>
<img src="http://roamlog.info/?ak_action=api_record_view&id=112&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://roamlog.info/archives/click-here.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Tips : shell bbcode style</title>
		<link>http://roamlog.info/archives/wordpress-tips-shell-bbcode-style.html</link>
		<comments>http://roamlog.info/archives/wordpress-tips-shell-bbcode-style.html#comments</comments>
		<pubDate>Thu, 08 Feb 2007 07:26:23 +0000</pubDate>
		<dc:creator>漫步</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress tips]]></category>

		<guid isPermaLink="false">http://roamlog.cn/index.php/2007/02/08/wordpress-tips-shell-bbcode-style/</guid>
		<description><![CDATA[把DRL的shell bbcode style增加进来，嘿嘿

/* vBulletin 3 CSS For Style 'DrL sTyLe 2.0' (styleid: 3) */
/* ***** shell bbcode style ***** */
.shell 
&#123; 
    width: 95%; 
    border: 1px solid #909090; 
    padding: 16px 8px 8px; 
    margin: 16px 8px 8px 8px; 
   [...]]]></description>
			<content:encoded><![CDATA[<p>把DRL的shell bbcode style增加进来，嘿嘿</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* vBulletin 3 CSS For Style 'DrL sTyLe 2.0' (styleid: 3) */</span>
<span style="color: #808080; font-style: italic;">/* ***** shell bbcode style ***** */</span>
.shell 
<span style="color: #00AA00;">&#123;</span> 
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">95</span>%</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;">#909090</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span> <span style="color: #933;">8px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span> <span style="color: #933;">8px</span> <span style="color: #933;">8px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">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;">font</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span> <span style="color: #ff0000;">&quot;lucida console&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;courier new&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;lucida grande&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.shell</span> a<span style="color: #3333ff;"><span style="color: #00AA00;">:</span>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;">#00ff00</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>
<span style="color: #6666ff;">.shell</span> a<span style="color: #3333ff;"><span style="color: #00AA00;">:</span>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;">#00ff00</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>
<span style="color: #6666ff;">.shell</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.thead</span> a<span style="color: #3333ff;"><span style="color: #00AA00;">:</span>active
</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;">#00ffff</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;">underline</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>用法</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;p class<span style="color: #00AA00;">=</span>shell<span style="color: #00AA00;">&gt;</span>内容&lt;/p<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>测试</p>
<p class=shell>测试</p>
<p>给 wordpress 增加 [shell] 的 quicktags 按钮</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">edButtons<span style="color: #009900;">&#91;</span>edButtons.<span style="color: #660066;">length</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
<span style="color: #003366; font-weight: bold;">new</span> edButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ed_shell'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'shell'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'&lt;p class=shell&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'&lt;/p&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">''</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-6"></span><br />
附 coolcode  page 的 quicktags 按钮 添加方法.</p>
<p class="shell">
coolcode
</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">edButtons<span style="color: #009900;">&#91;</span>edButtons.<span style="color: #660066;">length</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
<span style="color: #003366; font-weight: bold;">new</span> edButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ed_coolcode'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'coolcode'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'&lt;coolcode&gt;
'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'
&lt;/coolcode&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">''</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p class="shell">
page
</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">edButtons<span style="color: #009900;">&#91;</span>edButtons.<span style="color: #660066;">length</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
<span style="color: #003366; font-weight: bold;">new</span> edButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ed_page'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'page'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'&lt;!--page--&gt;'</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">''</span>
<span style="color: #339933;">,</span><span style="color: #3366CC;">'p'</span>
<span style="color: #339933;">,-</span><span style="color: #CC0000;">1</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<img src="http://roamlog.info/?ak_action=api_record_view&id=6&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://roamlog.info/archives/wordpress-tips-shell-bbcode-style.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

