<?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>Domety &#187; 摘要</title>
	<atom:link href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/feed/" rel="self" type="application/rss+xml" />
	<link>http://domety.com</link>
	<description>分享软件、互联网应用技巧以及开发技能</description>
	<lastBuildDate>Wed, 26 May 2010 14:28:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>the_content是如何输出摘要和全文的</title>
		<link>http://domety.com/archives/224/</link>
		<comments>http://domety.com/archives/224/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 14:27:46 +0000</pubDate>
		<dc:creator>DDBug</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[The Loop]]></category>
		<category><![CDATA[摘要]]></category>

		<guid isPermaLink="false">http://domety.com/?p=224</guid>
		<description><![CDATA[现在每次写文章的时候，已经习惯了在文章和第一段或前两段之后加一个more标签，这样首页的摘要就会显示more标签之前的内容。但是一直都有一个疑问，首页index.php和日志页面single.php都是调用the_content函数，为什么一个显示摘要，一个显示全文呢？
通过阅读wordpress的源代码，发现了这样一段代码
 if ( is_single() &#124;&#124; is_page() &#124;&#124; is_feed() )
  $more = 1;
难道是通过$more变量决定的？再去了解一下the_content的源代码，果然，就是通过$more变量来决定是输出摘要还是输出全文的。为了证实这个结论，我做了一个实验:
 修改index.php文件，在the_content之前强行把$more的值修改为1
$more = 1;
the_content();
结果之前一直显示摘要的首页，现在显示的是全文内容。同样，再去修改singel.php文件，在the_content之前强行把$more的值修改为0
$more = 0;
the_content();
结果日志页面显示的是摘要，而不是全文。
通过以上实验可以看出，the_content函数是输出全文还是输出摘要，是这个全局变量$more决定的。理解了这一点，我们就可以更灵活的运用the_content函数。下面通过一个实例来结束本文。
首页的第一篇文章显示全文，其它文章显示摘要：
&#60;?php if(have_posts() ){
                   $more = -1;
                   while(have_posts()){
                           the_post(); 
                           // ......
                          if($more == -1){
                                $more = 1;
                                the_content();
                                $more = 0;
                          } else {
                                the_content('继续阅读...');
                           }
                          // ......
                   }//end while(have_posts)
             }//end if(have_posts())
   else{
          echo '没有找到相关文章';
   }//end else
  ?&#62;
版权声明: 转载时请以超链接形式标明文章原始出处和作者信息本文来自: Domety&#187;《the_content是如何输出摘要和全文的》本文链接: http://domety.com/archives/224/本文作者: DDBug发表时期: 一月 13th,2010关键字: The LoopWordPress摘要本站的feed地址已经更改为http://feed.domety.com/,请朋友们手动更改一下，谢谢相关文章wordpress2.9模板果然支持page-slug和page-id了终于解决了半角引号自动转换为全角引号的问题小工具“随机文章”插件制作完成自制随机文章插件升级到1.1wordpress中显示页面位置：当前位置<ul style="color:#808080;padding:10px;border:1px solid #D7D7D7;list-style-type:none;"><li><a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>: 转载时请以超链接形式标明文章原始出处和作者信息</li><li>本文来自: <a href="http://domety.com">Domety</a>&raquo;<a href="http://domety.com/archives/224/">《the_content是如何输出摘要和全文的》</a></li><li>本文链接: <a href="http://domety.com/archives/224/" title="the_content是如何输出摘要和全文的">http://domety.com/archives/224/</a></li><li>本文作者: <a href="http://domety.com">DDBug</a></li><li>发表时期: 一月 13th,2010</li><li>关键字: <a href="http://domety.com/archives/tag/the-loop/" rel="tag">The Loop</a><a href="http://domety.com/archives/tag/wordpress/" rel="tag">WordPress</a><a href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/" rel="tag">摘要</a></li></ul><p style="color=red">本站的feed地址已经更改为<a href="http://feed.domety.com/">http://feed.domety.com/</a>,请朋友们手动更改一下，谢谢</p><h2>相关文章</h2><ul><li><a href="http://domety.com/archives/148/">WordPress性能测试——查看页面生成时间</a></li><li><a href="http://domety.com/archives/115/">WordPress中自定义你的文章链接</a></li><li><a href="http://domety.com/archives/200/">在feed中加入版权信息以及相关文章</a></li><li><a href="http://domety.com/archives/202/">wordpress循环之基础篇</a></li><li><a href="http://domety.com/archives/264/">如何设置wordpress主题的日期格式</a></li></ul>]]></description>
			<content:encoded><![CDATA[<p>现在每次写文章的时候，已经习惯了在文章和第一段或前两段之后加一个more标签，这样首页的摘要就会显示more标签之前的内容。但是一直都有一个疑问，首页index.php和日志页面single.php都是调用the_content函数，为什么一个显示摘要，一个显示全文呢？<span id="more-224"></span></p>
<p>通过阅读wordpress的源代码，发现了这样一段代码</p>
<pre> if ( is_single() || is_page() || is_feed() )
  $more = 1;</pre>
<p>难道是通过$more变量决定的？再去了解一下the_content的源代码，果然，就是通过$more变量来决定是输出摘要还是输出全文的。为了证实这个结论，我做了一个实验:</p>
<p> 修改index.php文件，在the_content之前强行把$more的值修改为1</p>
<pre>$more = 1;
the_content();</pre>
<p>结果之前一直显示摘要的首页，现在显示的是全文内容。同样，再去修改singel.php文件，在the_content之前强行把$more的值修改为0</p>
<pre>$more = 0;
the_content();</pre>
<p>结果日志页面显示的是摘要，而不是全文。</p>
<p>通过以上实验可以看出，the_content函数是输出全文还是输出摘要，是这个全局变量$more决定的。理解了这一点，我们就可以更灵活的运用the_content函数。下面通过一个实例来结束本文。</p>
<p>首页的第一篇文章显示全文，其它文章显示摘要：</p>
<pre>&lt;?php if(have_posts() ){
                   $more = -1;
                   while(have_posts()){
                           the_post(); 
                           // ......
                          if($more == -1){
                                $more = 1;
                                the_content();
                                $more = 0;
                          } else {
                                the_content('继续阅读...');
                           }
                          // ......
                   }//end while(have_posts)
             }//end if(have_posts())
   else{
          echo '没有找到相关文章';
   }//end else
  ?&gt;</pre>
<ul style="color:#808080;padding:10px;border:1px solid #D7D7D7;list-style-type:none;"><li><a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>: 转载时请以超链接形式标明文章原始出处和作者信息</li><li>本文来自: <a href="http://domety.com">Domety</a>&raquo;<a href="http://domety.com/archives/224/">《the_content是如何输出摘要和全文的》</a></li><li>本文链接: <a href="http://domety.com/archives/224/" title="the_content是如何输出摘要和全文的">http://domety.com/archives/224/</a></li><li>本文作者: <a href="http://domety.com">DDBug</a></li><li>发表时期: 一月 13th,2010</li><li>关键字: <a href="http://domety.com/archives/tag/the-loop/" rel="tag">The Loop</a><a href="http://domety.com/archives/tag/wordpress/" rel="tag">WordPress</a><a href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/" rel="tag">摘要</a></li></ul><p style="color=red">本站的feed地址已经更改为<a href="http://feed.domety.com/">http://feed.domety.com/</a>,请朋友们手动更改一下，谢谢</p><h2>相关文章</h2><ul><li><a href="http://domety.com/archives/188/">为wordpress添加阅读RSS功能</a></li><li><a href="http://domety.com/archives/195/">wordpress订阅RSS最新方法</a></li><li><a href="http://domety.com/archives/210/">wordpress自定义页面</a></li><li><a href="http://domety.com/archives/139/">WordPress添加“随机文章”模块</a></li><li><a href="http://domety.com/archives/212/">wordpress博客搬家过程</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://domety.com/archives/224/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>自定义more标签的more跳转</title>
		<link>http://domety.com/archives/220/</link>
		<comments>http://domety.com/archives/220/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 14:35:17 +0000</pubDate>
		<dc:creator>DDBug</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[摘要]]></category>
		<category><![CDATA[正则表达式]]></category>

		<guid isPermaLink="false">http://domety.com/?p=220</guid>
		<description><![CDATA[很多主题首页的摘要都是使用the_content()函数来实现的，使用这种方法会在摘要结束的地方自动生成 一个more链接，比如&#8221;阅读更多&#8221;或&#8221;阅读全文&#8221;之类，当你点击这个链接之后会自动跳转到该日志页面摘要之后的部分。如果你喜欢这样的效果，那自然很好，不用修改。但是如果你不喜欢这种效果，而是想跳转到文章最开始的部分，那就继续向下看。
其实我们不难发现，more链接的链接地址就是在日志的链接地址之后加了一个#more-id，我们如果有办法把这个#more-id从链接中去掉不就行了吗？幸好wordpress给我们提供了一个叫做the_content_more_link的filter，通过它再加上正则表达式，可以很轻松的解决这个问题。

function remove_more_jump_link($link) {
return preg_replace('/#more-\d+/i','',$link);
}
add_filter('the_content_more_link', 'remove_more_jump_link');

把以上代码复制到functions.php文件即可。代码中的正则表达式也很好理解，就是把链接中#more-id形式的字符串替换为空。
版权声明: 转载时请以超链接形式标明文章原始出处和作者信息本文来自: Domety&#187;《自定义more标签的more跳转》本文链接: http://domety.com/archives/220/本文作者: DDBug发表时期: 一月 10th,2010关键字: WordPress摘要正则表达式本站的feed地址已经更改为http://feed.domety.com/,请朋友们手动更改一下，谢谢相关文章wordpress自定义页面个性评论头像——图解gravatar全球通用头像把wordpress分类添加到导航菜单WordPress添加“随机文章”模块升级到wordpress2.9原来如此简单<ul style="color:#808080;padding:10px;border:1px solid #D7D7D7;list-style-type:none;"><li><a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>: 转载时请以超链接形式标明文章原始出处和作者信息</li><li>本文来自: <a href="http://domety.com">Domety</a>&raquo;<a href="http://domety.com/archives/220/">《自定义more标签的more跳转》</a></li><li>本文链接: <a href="http://domety.com/archives/220/" title="自定义more标签的more跳转">http://domety.com/archives/220/</a></li><li>本文作者: <a href="http://domety.com">DDBug</a></li><li>发表时期: 一月 10th,2010</li><li>关键字: <a href="http://domety.com/archives/tag/wordpress/" rel="tag">WordPress</a><a href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/" rel="tag">摘要</a><a href="http://domety.com/archives/tag/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f/" rel="tag">正则表达式</a></li></ul><p style="color=red">本站的feed地址已经更改为<a href="http://feed.domety.com/">http://feed.domety.com/</a>,请朋友们手动更改一下，谢谢</p><h2>相关文章</h2><ul><li><a href="http://domety.com/archives/181/">了解wordpress模板(主题)系统</a></li><li><a href="http://domety.com/archives/179/">Domety正式更换主题为win</a></li><li><a href="http://domety.com/archives/177/">wordpress代码实现&#8221;最近评论&#8221;</a></li><li><a href="http://domety.com/archives/233/">为页面标题添加页码</a></li><li><a href="http://domety.com/archives/94/">给网站(博客)添加RSS订阅到(google、鲜果、有道、QQ邮箱)</a></li></ul>]]></description>
			<content:encoded><![CDATA[<p>很多主题首页的摘要都是使用the_content()函数来实现的，使用这种方法会在摘要结束的地方自动生成 一个more链接，比如&#8221;阅读更多&#8221;或&#8221;阅读全文&#8221;之类，当你点击这个链接之后会自动跳转到该日志页面摘要之后的部分。如果你喜欢这样的效果，那自然很好，不用修改。但是如果你不喜欢这种效果，而是想跳转到文章最开始的部分，那就继续向下看。</p>
<p>其实我们不难发现，more链接的链接地址就是在日志的链接地址之后加了一个#more-id，我们如果有办法把这个#more-id从链接中去掉不就行了吗？幸好wordpress给我们提供了一个叫做the_content_more_link的filter，通过它再加上正则表达式，可以很轻松的解决这个问题。</p>
<pre>
<div id="_mcePaste">function remove_more_jump_link($link) {</div>
<div id="_mcePaste">return preg_replace('/#more-\d+/i','',$link);</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">add_filter('the_content_more_link', 'remove_more_jump_link');</div>
</pre>
<p>把以上代码复制到functions.php文件即可。代码中的正则表达式也很好理解，就是把链接中#more-id形式的字符串替换为空。</p>
<ul style="color:#808080;padding:10px;border:1px solid #D7D7D7;list-style-type:none;"><li><a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>: 转载时请以超链接形式标明文章原始出处和作者信息</li><li>本文来自: <a href="http://domety.com">Domety</a>&raquo;<a href="http://domety.com/archives/220/">《自定义more标签的more跳转》</a></li><li>本文链接: <a href="http://domety.com/archives/220/" title="自定义more标签的more跳转">http://domety.com/archives/220/</a></li><li>本文作者: <a href="http://domety.com">DDBug</a></li><li>发表时期: 一月 10th,2010</li><li>关键字: <a href="http://domety.com/archives/tag/wordpress/" rel="tag">WordPress</a><a href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/" rel="tag">摘要</a><a href="http://domety.com/archives/tag/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f/" rel="tag">正则表达式</a></li></ul><p style="color=red">本站的feed地址已经更改为<a href="http://feed.domety.com/">http://feed.domety.com/</a>,请朋友们手动更改一下，谢谢</p><h2>相关文章</h2><ul><li><a href="http://domety.com/archives/177/">wordpress代码实现&#8221;最近评论&#8221;</a></li><li><a href="http://domety.com/archives/84/">成功升级WordPress到2.8.5</a></li><li><a href="http://domety.com/archives/247/">开启Akismet插件，自动过滤垃圾留言</a></li><li><a href="http://domety.com/archives/202/">wordpress循环之基础篇</a></li><li><a href="http://domety.com/archives/233/">为页面标题添加页码</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://domety.com/archives/220/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress首页显示摘要的几种方法</title>
		<link>http://domety.com/archives/216/</link>
		<comments>http://domety.com/archives/216/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 14:12:54 +0000</pubDate>
		<dc:creator>DDBug</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[摘要]]></category>

		<guid isPermaLink="false">http://domety.com/?p=216</guid>
		<description><![CDATA[大部分人的习惯都是在首页显示文章的摘要，本文总结了几种在首页显示摘要的方法。

more标签
这种方法应该是最灵活的一种方法，操作也很简单，只需要你在编辑文章的时候插入more标签

或者使用快捷键alt+shift+t，效果如下

那么如果你在主题的首页模板中调用the_content函数，首页的文章摘要就显示more之前的内容。相反，如果没有插入more标签，就会显示全文。
手动输入摘要
在首页模板中(比如home.php或index.php)中调用the_excerpt函数显示摘要，如果你在编辑文章的时候，在下面的“摘要”内输入了内容，则会显示该“摘要”里的内容

如果“摘要”里没有内容，就输出more标签前的内容，再如果没有more标签，就输出固定字数的摘要（这个固定的字数好像是默认的，很长，我还没找到更改这个字数的方法，有知道的希望告之）。
显示固定的字数
如果你的主机开通了php的mb_string扩展的话，可以使用mb_strimwidth函数来截取文章内容，以达到显示固定字数摘要的目的，比如首页摘要显示前200个字
echo mb_strimwidth(strip_tags($post-&#62;post_content),0,200,'......');
这样就会显示文章的前200个字，随后跟着一个省略号。这个mb_strimwidth函数可以很好截取中文字符。我们再稍改造一下，就可以显示“阅读全文”链接的效果
echo mb_strimwidth(strip_tags($post-&#62;post_content),0,200,'&#60;a href="'.get_permalink().'"&#62;......[阅读全文]&#60;/a&#62;');
但是，如果假如万一你的主机没有激活php的mb_string扩展，使用这个函数就会报错。在这种情况下，我们可以自定义一个类似的函数，下面是我写的一个截取utf-8字符串的函数dm_strimwidth，也是我正在使用的方法
function dm_strimwidth($str ,$start , $width ,$trimmarker ){
 $output = preg_replace('/^(?:[\x00-\x7F]&#124;[\xC0-\xFF][\x80-\xBF]+){0,'.$start.'}((?:[\x00-\x7F]&#124;[\xC0-\xFF][\x80-\xBF]+){0,'.$width.'}).*/s','\1',$str);
 return $output.$trimmarker;
}
使用方法和前面的mb_strimwidth是一样的，不过使用前你需要把上面的函数定义复制到functions.php文件中，然后调用
echo dm_strimwidth(strip_tags($post-&#62;post_content),0,200,'&#60;a href="'.get_permalink().'"&#62;......[阅读全文]&#60;/a&#62;');
综合方法
有时候下面这种做法也是不错的，即如果给文章手动添加了摘要，就显示这个手动添加的摘要，如果没有就显示固定的字数。方法如下：
if(has_excerpt()) the_excerpt();
 else
         echo mb_strimwidth(strip_tags($post-&#62;post_content),0,200,'&#60;a href="'.get_permalink().'"&#62;......[阅读全文]&#60;/a&#62;');
版权声明: 转载时请以超链接形式标明文章原始出处和作者信息本文来自: Domety&#187;《wordpress首页显示摘要的几种方法》本文链接: http://domety.com/archives/216/本文作者: DDBug发表时期: 一月 9th,2010关键字: WordPress摘要本站的feed地址已经更改为http://feed.domety.com/,请朋友们手动更改一下，谢谢相关文章WordPress添加“随机文章”模块升级到wordpress2.9原来如此简单如何设置wordpress主题的日期格式了解wordpress模板(主题)系统wordpress2.9模板果然支持page-slug和page-id了<ul style="color:#808080;padding:10px;border:1px solid #D7D7D7;list-style-type:none;"><li><a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>: 转载时请以超链接形式标明文章原始出处和作者信息</li><li>本文来自: <a href="http://domety.com">Domety</a>&raquo;<a href="http://domety.com/archives/216/">《wordpress首页显示摘要的几种方法》</a></li><li>本文链接: <a href="http://domety.com/archives/216/" title="wordpress首页显示摘要的几种方法">http://domety.com/archives/216/</a></li><li>本文作者: <a href="http://domety.com">DDBug</a></li><li>发表时期: 一月 9th,2010</li><li>关键字: <a href="http://domety.com/archives/tag/wordpress/" rel="tag">WordPress</a><a href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/" rel="tag">摘要</a></li></ul><p style="color=red">本站的feed地址已经更改为<a href="http://feed.domety.com/">http://feed.domety.com/</a>,请朋友们手动更改一下，谢谢</p><h2>相关文章</h2><ul><li><a href="http://domety.com/archives/115/">WordPress中自定义你的文章链接</a></li><li><a href="http://domety.com/archives/233/">为页面标题添加页码</a></li><li><a href="http://domety.com/archives/154/">如何制作WordPress插件</a></li><li><a href="http://domety.com/archives/199/">向搜索引擎提交站点</a></li><li><a href="http://domety.com/archives/169/">详解wordpress安装过程</a></li></ul>]]></description>
			<content:encoded><![CDATA[<p>大部分人的习惯都是在首页显示文章的摘要，本文总结了几种在首页显示摘要的方法。</p>
<p><span id="more-216"></span></p>
<h3>more标签</h3>
<p>这种方法应该是最灵活的一种方法，操作也很简单，只需要你在编辑文章的时候插入more标签</p>
<p><img class="alignnone" title="more标签" src="http://i623.domety.com/albums/tt312/baolai5/201001/wp_excerpt_001.png" alt="" width="508" height="92" /></p>
<p>或者使用快捷键alt+shift+t，效果如下</p>
<p><img class="alignnone" title="more" src="http://i623.domety.com/albums/tt312/baolai5/201001/wp_excerpt_002.png" alt="" width="494" height="91" /></p>
<p>那么如果你在主题的首页模板中调用the_content函数，首页的文章摘要就显示more之前的内容。相反，如果没有插入more标签，就会显示全文。</p>
<h3>手动输入摘要</h3>
<p>在首页模板中(比如home.php或index.php)中调用the_excerpt函数显示摘要，如果你在编辑文章的时候，在下面的“摘要”内输入了内容，则会显示该“摘要”里的内容</p>
<p><img class="alignnone" title="输入摘要" src="http://i623.domety.com/albums/tt312/baolai5/201001/wp_excerpt_003.png" alt="" width="509" height="139" /></p>
<p>如果“摘要”里没有内容，就输出more标签前的内容，再如果没有more标签，就输出固定字数的摘要（这个固定的字数好像是默认的，很长，我还没找到更改这个字数的方法，有知道的希望告之）。</p>
<h3>显示固定的字数</h3>
<p>如果你的主机开通了php的mb_string扩展的话，可以使用mb_strimwidth函数来截取文章内容，以达到显示固定字数摘要的目的，比如首页摘要显示前200个字</p>
<pre>echo mb_strimwidth(strip_tags($post-&gt;post_content),0,200,'......');</pre>
<p>这样就会显示文章的前200个字，随后跟着一个省略号。这个mb_strimwidth函数可以很好截取中文字符。我们再稍改造一下，就可以显示“阅读全文”链接的效果</p>
<pre>echo mb_strimwidth(strip_tags($post-&gt;post_content),0,200,'&lt;a href="'.get_permalink().'"&gt;......[阅读全文]&lt;/a&gt;');</pre>
<p>但是，如果假如万一你的主机没有激活php的mb_string扩展，使用这个函数就会报错。在这种情况下，我们可以自定义一个类似的函数，下面是我写的一个截取utf-8字符串的函数dm_strimwidth，也是我正在使用的方法</p>
<pre>function dm_strimwidth($str ,$start , $width ,$trimmarker ){
 $output = preg_replace('/^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$start.'}((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$width.'}).*/s','\1',$str);
 return $output.$trimmarker;
}</pre>
<p>使用方法和前面的mb_strimwidth是一样的，不过使用前你需要把上面的函数定义复制到functions.php文件中，然后调用</p>
<pre>echo dm_strimwidth(strip_tags($post-&gt;post_content),0,200,'&lt;a href="'.get_permalink().'"&gt;......[阅读全文]&lt;/a&gt;');</pre>
<h3>综合方法</h3>
<p>有时候下面这种做法也是不错的，即如果给文章手动添加了摘要，就显示这个手动添加的摘要，如果没有就显示固定的字数。方法如下：</p>
<pre>if(has_excerpt()) the_excerpt();
 else
         echo mb_strimwidth(strip_tags($post-&gt;post_content),0,200,'&lt;a href="'.get_permalink().'"&gt;......[阅读全文]&lt;/a&gt;');</pre>
<ul style="color:#808080;padding:10px;border:1px solid #D7D7D7;list-style-type:none;"><li><a href="http://creativecommons.org/licenses/by/3.0/deed.zh">版权声明</a>: 转载时请以超链接形式标明文章原始出处和作者信息</li><li>本文来自: <a href="http://domety.com">Domety</a>&raquo;<a href="http://domety.com/archives/216/">《wordpress首页显示摘要的几种方法》</a></li><li>本文链接: <a href="http://domety.com/archives/216/" title="wordpress首页显示摘要的几种方法">http://domety.com/archives/216/</a></li><li>本文作者: <a href="http://domety.com">DDBug</a></li><li>发表时期: 一月 9th,2010</li><li>关键字: <a href="http://domety.com/archives/tag/wordpress/" rel="tag">WordPress</a><a href="http://domety.com/archives/tag/%e6%91%98%e8%a6%81/" rel="tag">摘要</a></li></ul><p style="color=red">本站的feed地址已经更改为<a href="http://feed.domety.com/">http://feed.domety.com/</a>,请朋友们手动更改一下，谢谢</p><h2>相关文章</h2><ul><li><a href="http://domety.com/archives/139/">WordPress添加“随机文章”模块</a></li><li><a href="http://domety.com/archives/169/">详解wordpress安装过程</a></li><li><a href="http://domety.com/archives/115/">WordPress中自定义你的文章链接</a></li><li><a href="http://domety.com/archives/150/">个性评论头像——图解gravatar全球通用头像</a></li><li><a href="http://domety.com/archives/190/">升级到wordpress2.9原来如此简单</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://domety.com/archives/216/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
