<?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>Y-Space &#187; k2</title>
	<atom:link href="http://www.1990y.com/tag/k2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.1990y.com</link>
	<description>A bad beginning makes a bad ending.</description>
	<lastBuildDate>Tue, 08 Dec 2009 16:40:53 +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>使用K2主题时如何在首页显示摘要</title>
		<link>http://www.1990y.com/k2-using-subject-of-how-to-display-on-the-first-page-summary/</link>
		<comments>http://www.1990y.com/k2-using-subject-of-how-to-display-on-the-first-page-summary/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 15:06:28 +0000</pubDate>
		<dc:creator>yeasiz</dc:creator>
				<category><![CDATA[Skills]]></category>
		<category><![CDATA[k2]]></category>
		<category><![CDATA[Works]]></category>

		<guid isPermaLink="false">http://www.1990y.com/?p=169</guid>
		<description><![CDATA[首先提出来的问题是：
我们为什么要在Wordpress首页显示摘要？
在Wordpress首页摘要可以让：

首页页面美观，不会因为每篇文章的长短不同，有无图片而造成页面的长短不一；
首页载入速度更快，首页内容提要没有图片，没有视频，只有少量文字，在进入首页后，能够更迅速地显示；
增加文章页面的阅读程度。

那么，
如何在Wordpress首页显示摘要呢？
根据我们以往的经验，只要在你启用的皮肤文件夹里找到 index.php
将

&#60;!--p the_content&#40;&#41;;--&#62;

替换为

&#60;!--p the_excerpt&#40;&#41;;--&#62;

即可
但是在K2主题中，index.php 文件内找不到 语句，这是因为K2主题的不同页面，包括 index.php，single.php，search.php，archive.php 等都是通过间接调用 theloop.php 文件实现的。所以，我们只要在 theloop.php 文件中找到第 146 行，将

&#60;!--p the_content&#40;sprintf&#40;__&#40;&#34;Continue reading '%s'&#34;, 'k2_domain'&#41;, the_title&#40;'', '', false&#41;&#41;&#41;;--&#62;

替换为

&#60;!--p if &#40; is_single&#40;&#41; &#41;&#123;
    the_content&#40;sprintf&#40;__&#40;&#34;Continue reading '%s'&#34;, 'k2_domain'&#41;, the_title&#40;'', '', false&#41;&#41;&#41;;
&#125; else &#123;
    the_excerpt&#40;&#41;;
&#125;--&#62;

即可
这里，主要是增加了一个判断语句，如果是独立文章，则显示全文；否则，显示摘要。
当然，如果你希望在其他页面也显示全文，则可以自己对上述代码进行修改。常用的判断函数有：首页 is_home，独立文章页 is_single，搜索结果页 is_search，存档文章页 is_archive（还可以细分为按作者存档 is_author，按分类存档 is_category，按年存档 is_year，按月存档 is_month，按日存档 is_day 等），Tage 文章页 is_tag 等等。
至此，你的wordpress，除非打开单个post，其他情况下都是显示摘要。
本文参考：让wordpress博客首页仅显示摘要
                Wordpress 技巧: [...]]]></description>
			<content:encoded><![CDATA[<p>首先提出来的问题是：</p>
<blockquote><p>我们为什么要在Wordpress首页显示摘要？</p></blockquote>
<p>在Wordpress首页摘要可以让：</p>
<ul>
<li><strong>首页页面美观，不会因为每篇文章的长短不同，有无图片而造成页面的长短不一；</strong></li>
<li><strong>首页载入速度更快，首页内容提要没有图片，没有视频，只有少量文字，在进入首页后，能够更迅速地显示；</strong></li>
<li><strong>增加文章页面的阅读程度。</strong></li>
</ul>
<p>那么，</p>
<blockquote><p>如何在Wordpress首页显示摘要呢？</p></blockquote>
<p>根据我们以往的经验，只要在你启用的皮肤文件夹里找到 index.php</p>
<p>将</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>p the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;--&gt;</span></pre></div></div>

<p>替换为</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>p the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;--&gt;</span></pre></div></div>

<p>即可</p>
<p>但是在K2主题中，index.php 文件内找不到 <!--p the_content();-->语句，这是因为K2主题的不同页面，包括 index.php，single.php，search.php，archive.php 等都是通过间接调用 theloop.php 文件实现的。所以，我们只要在 theloop.php 文件中找到第 <span style="color: #ff0000;">146 </span>行，将</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>p the_content<span style="color: #009900;">&#40;</span><span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Continue reading '<span style="color: #009933; font-weight: bold;">%s</span>'&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'k2_domain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;--&gt;</span></pre></div></div>

<p>替换为</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>p <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>
    the_content<span style="color: #009900;">&#40;</span><span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Continue reading '<span style="color: #009933; font-weight: bold;">%s</span>'&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'k2_domain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">--&gt;</span></pre></div></div>

<p>即可</p>
<p>这里，主要是增加了一个判断语句，如果是独立文章，则显示全文；否则，显示摘要。</p>
<p>当然，如果你希望在其他页面也显示全文，则可以自己对上述代码进行修改。常用的判断函数有：首页 is_home，独立文章页 is_single，搜索结果页 is_search，存档文章页 is_archive（还可以细分为按作者存档 is_author，按分类存档 is_category，按年存档 is_year，按月存档 is_month，按日存档 is_day 等），Tage 文章页 is_tag 等等。</p>
<p>至此，你的wordpress，除非打开单个post，其他情况下都是显示摘要。</p>
<p>本文参考：<a href="http://www.dwgoogle.cn/articles/%E8%AE%A9wordpress%E5%8D%9A%E5%AE%A2%E9%A6%96%E9%A1%B5%E4%BB%85%E6%98%BE%E7%A4%BA%E6%91%98%E8%A6%81.html" target="_blank">让wordpress博客首页仅显示摘要</a><br />
                <a href="http://jiangzhanyong.com/2007/07/wordpress-tip-content-or-excerpt-with-k2-theme-470.html" target="_blank">Wordpress 技巧: K2 主题如何实现分别输出全文和摘要</a></p>
<h3  class="related_post_title">喜欢本文的读者还阅读：</h3><ul class="related_post"><li><a href="http://www.1990y.com/k2zhcn/" title="K2 Chinese">K2 Chinese</a></li><li><a href="http://www.1990y.com/alexa-ranking/" title="網站Alexa排名查詢工具">網站Alexa排名查詢工具</a></li></ul><a href="http://www.1990y.com/k2-using-subject-of-how-to-display-on-the-first-page-summary/#comments"># Y-Space评论组友情提醒：沙发还在:)</a>
<hr />
<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh">©</a>yeasiz for <a href="http://www.1990y.com">Y-Space</a>,<a href="http://www.1990y.com/category/skills/" title="View all posts in Skills" rel="category tag">Skills</a>. |
<a href="http://www.1990y.com/k2-using-subject-of-how-to-display-on-the-first-page-summary/">原文链接</a>]]></content:encoded>
			<wfw:commentRss>http://www.1990y.com/k2-using-subject-of-how-to-display-on-the-first-page-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
