<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>请输入一个名称！ &#187; 帖子：不用修改博客主页直接在首页显示摘要</title>
		<link>http://home.wpjam.com/wp-content/plugins/buddypress/bp-forums/bbpress/topic/146</link>
		<description>请输入一个名称！ &raquo; 帖子：不用修改博客主页直接在首页显示摘要</description>
		<language>zh-CN</language>
		<pubDate>Mon, 06 Feb 2012 02:12:25 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[搜索]]></title>
			<description><![CDATA[在这些版面中搜索全部帖子。]]></description>
			<name>q</name>
			<link>http://home.wpjam.com/wp-content/plugins/buddypress/bp-forums/bbpress/search.php</link>
		</textInput>
		<atom:link href="http://home.wpjam.com/wp-content/plugins/buddypress/bp-forums/bbpress/rss/topic/146" rel="self" type="application/rss+xml" />

		<item>
						<title>不用修改博客主页直接在首页显示摘要</title>
			<link>http://home.wpjam.com/wp-content/plugins/buddypress/bp-forums/bbpress/topic/146#post-219</link>
			<pubDate>三, 20 Jan 2010 18:18:13 +0000</pubDate>
			<dc:creator>匿名</dc:creator>
			<guid isPermaLink="false">219@http://home.wpjam.com/wp-content/plugins/buddypress/bp-forums/bbpress/</guid>
			<description>&#60;p&#62;Replace full post by excerpts on homepage without editing your theme files&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;What you have to do is to paste this code into your functions.php file and let WordPress filters do the work for you.

function my_excerpts($content = false) {
        // If is the home page, an archive, or search results
	if(is_front_page() &#124;&#124; is_archive() &#124;&#124; is_search()) :
		global $post;
		$content = $post-&#38;gt;post_excerpt;

	// If an excerpt is set in the Optional Excerpt box
		if($content) :
			$content = apply_filters(&#38;#39;the_excerpt&#38;#39;, $content);

	// If no excerpt is set
		else :
			$content = $post-&#38;gt;post_content;
			$excerpt_length = 55;
			$words = explode(&#38;#39; &#38;#39;, $content, $excerpt_length + 1);
			if(count($words) &#38;gt; $excerpt_length) :
				array_pop($words);
				array_push($words, &#38;#39;...&#38;#39;);
				$content = implode(&#38;#39; &#38;#39;, $words);
			endif;
			$content = &#38;#39;&#38;lt;p&#38;gt;&#38;#39; . $content . &#38;#39;&#38;lt;/p&#38;gt;&#38;#39;;

		endif;
	endif;

// Make sure to return the content
	return $content;

}

add_filter(&#38;#39;the_content&#38;#39;, &#38;#39;my_excerpts&#38;#39;);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>

