<?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>WordPress后援基地 &#187; 修改</title>
	<atom:link href="http://www.wpservice.org/tag/%e4%bf%ae%e6%94%b9/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wpservice.org</link>
	<description>WP强有力支持</description>
	<lastBuildDate>Tue, 07 Apr 2009 13:12:00 +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>Wordpress中10个有用的RSS技巧和修改(二)</title>
		<link>http://www.wpservice.org/2009/03/17/wordpress-in-10-useful-skills-and-modify-rss-2/</link>
		<comments>http://www.wpservice.org/2009/03/17/wordpress-in-10-useful-skills-and-modify-rss-2/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 01:32:31 +0000</pubDate>
		<dc:creator>老薛</dc:creator>
				<category><![CDATA[使用技巧]]></category>
		<category><![CDATA[修改]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[技巧]]></category>

		<guid isPermaLink="false">http://www.wpservice.org/?p=13</guid>
		<description><![CDATA[4. 为Feed阅读器排版你的图片



问题：你花费了大量的时间写文章和排版来让它们看起来整洁又美观。在你的Blog上看这些内容真是帅呆了。但遗憾的是，当文章出现在Google  Reader或是其他RSS阅读器上时，它就不是这回事儿了。
解决方案：这是由于大多数feed阅读器都将图片直接插入到文本中导致的：

为了避免这个问题的出现，添加一个CSS class让图片以一个区块的方式显示。Wordpress提供内建的class”center“:
【img class=&#8221;center&#8221; src=&#8221;http://78.46.108.98/images/wordpress-rss-hacks/myimage.jpg&#8221; alt=&#8221;This is my image&#8221; /】
来源：How  to format images for feed readers
5. 为你的每篇文章准备一个单独的Feed

问题:当一篇文章有大量的评论时，对读者来说加入讨论是非常困难的事。大多数Wordpress用户并不清楚这个问题，但我们的最佳Blog引擎其实有一个内建的功能来为每篇文章的评论提供一个RSS  feed。
解决方案:其实，这并不能算是严格意义上的修改或是什么别的：实现给特定文章提供一个RSS  feed，只需使用comment_rss_link() 功能：
&#60; ?php comments_rss_link(&#8216;&#38;raquo; Comments RSS Feed&#8217;); ?&#62;
来源：WordPress  how to: provide an RSS feed for the comments in each post
6. 从你的RSS  Feed中排除分类
问题:你是否使用了一个博客分类来让读者了解你的网站新闻，或是你的Blog的有一个分类对其余的内容来说一点用也没有？如果是，那么把它包括在你的RSS  feed中就不是一个好主意。
解决方案:怎样从你的RSS feed中去掉一个分类:
1. 首先，找到你要排除掉的分类的数字ID。如果你不知道怎么找到一个特定分类的ID，你可以先看看这篇文章。
2. 当你知道了你要从RSS  feed中排除的ID，编辑你的主题的functions.php文件。如果它不存在，创建之。
3. 将下面的代码复制进去：


function [...]]]></description>
			<content:encoded><![CDATA[<p><strong>4. 为Feed阅读器排版你的图片</strong></p>
<p><strong><img class="alignnone size-full wp-image-15" title="1" src="http://www.wpservice.org/wp-content/uploads/2009/03/1.jpg" alt="1" width="489" height="270" /></strong></p>
<p><strong><span id="more-13"></span><br />
</strong></p>
<p><strong>问题：</strong>你花费了大量的时间写文章和排版来让它们看起来整洁又美观。在你的Blog上看这些内容真是帅呆了。但遗憾的是，当文章出现在Google  Reader或是其他RSS阅读器上时，它就不是这回事儿了。</p>
<p><strong>解决方案：</strong>这是由于大多数feed阅读器都将图片直接插入到文本中导致的：</p>
<p><img class="alignnone size-full wp-image-16" title="2" src="http://www.wpservice.org/wp-content/uploads/2009/03/2.jpg" alt="2" width="500" height="172" /></p>
<p>为了避免这个问题的出现，添加一个CSS class让图片以一个区块的方式显示。Wordpress提供内建的class”center“:</p>
<blockquote><p>【img class=&#8221;center&#8221; src=&#8221;http://78.46.108.98/images/wordpress-rss-hacks/myimage.jpg&#8221; alt=&#8221;This is my image&#8221; /】</p></blockquote>
<p>来源：<a href="http://www.pearsonified.com/2007/06/how-to-format-images-for-feed-readers.php">How  to format images for feed readers</a></p>
<p><strong>5. 为你的每篇文章准备一个单独的Feed</strong></p>
<p><strong><img class="alignnone size-full wp-image-17" title="3" src="http://www.wpservice.org/wp-content/uploads/2009/03/3.png" alt="3" width="393" height="180" /></strong></p>
<p><strong>问题:</strong>当一篇文章有大量的评论时，对读者来说加入讨论是非常困难的事。大多数Wordpress用户并不清楚这个问题，但我们的最佳Blog引擎其实有一个内建的功能来为每篇文章的评论提供一个RSS  feed。</p>
<p><strong>解决方案:</strong>其实，这并不能算是严格意义上的修改或是什么别的：实现给特定文章提供一个RSS  feed，只需使用comment_rss_link() 功能：</p>
<blockquote><p>&lt; ?php comments_rss_link(&#8216;&amp;raquo; Comments RSS Feed&#8217;); ?&gt;</p></blockquote>
<p>来源：<a href="http://www.wprecipes.com/wordpress-how-to-provide-rss-feed-for-each-post-comments">WordPress  how to: provide an RSS feed for the comments in each post</a></p>
<p><strong>6. 从你的RSS  Feed中排除分类</strong><br />
<strong>问题:</strong>你是否使用了一个博客分类来让读者了解你的网站新闻，或是你的Blog的有一个分类对其余的内容来说一点用也没有？如果是，那么把它包括在你的RSS  feed中就不是一个好主意。</p>
<p><strong>解决方案:</strong>怎样从你的RSS feed中去掉一个分类:</p>
<p>1. 首先，找到你要排除掉的分类的数字ID。如果你不知道怎么找到一个特定分类的ID，你可以先看看这篇文章。<br />
2. 当你知道了你要从RSS  feed中排除的ID，编辑你的主题的functions.php文件。如果它不存在，创建之。<br />
3. 将下面的代码复制进去：</p>
<blockquote>
<ol class="hl-main ln-show" title="Double click to hide line number.">
<li class="hl-firstline">function myFilter($query) {</li>
<li>if ($query-&amp;gt;is_feed) {</li>
<li>$query-&amp;gt;set(&#8216;cat&#8217;,'-5&#8242;); //Don&#8217;t forget to change the category ID  =^o^=</li>
<li>}</li>
<li>return $query;</li>
<li>}</li>
<li>add_filter(&#8216;pre_get_posts&#8217;,'myFilter&#8217;);</li>
</ol>
</blockquote>
<p>4.保存文件，搞定！</p>
<p><strong>代码解释:</strong> 这次修改实际上和之前说的那个一样：创建一个自动以的功能来排除那个你不想让它出现在RSS  feed中的类别，然后使用非常有用的add_filter() 功能来让它在这个Wordpress核心功能pre_get_posts() 上提交。</p>
<p>来源：<a href="http://www.jangro.com/a/2008/03/01/excluding-posts-from-your-blog-feed/">Excluding  posts from your WordPress feed</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpservice.org/2009/03/17/wordpress-in-10-useful-skills-and-modify-rss-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress中10个有用的RSS技巧和修改(一)</title>
		<link>http://www.wpservice.org/2009/02/18/wordpress-in-10-useful-skills-and-modify-rss-1/</link>
		<comments>http://www.wpservice.org/2009/02/18/wordpress-in-10-useful-skills-and-modify-rss-1/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 14:16:54 +0000</pubDate>
		<dc:creator>老薛</dc:creator>
				<category><![CDATA[使用技巧]]></category>
		<category><![CDATA[修改]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[技巧]]></category>

		<guid isPermaLink="false">http://www.wpservice.org/?p=1</guid>
		<description><![CDATA[RSS是一项非常简单同时非常强大的技术。如今，RSS是Blog内容联合的事实标准，它被同时广泛应用于个人和商业环境中；比如，在Blog中。而且因为这些Blog中的很大一部分是运行于Wordpress，我们将在本文中涉及到一些（也许）相对而言不为人所知但是有用的RSS相关技巧和修改，希望藉由这些技巧可以帮助你更有效的使用RSS  — 而不用使用一些不必要和臃肿的WordPress插件。
让我们看看10个有用但不为人所知的Wordpress  RSS技巧。这篇文章的每个部分提出一个问题，建议一个解决方案以及对这个解决方案的解释，这样不仅解决了你的RSS相关问题，同时让你了解你究竟在做什么，据此，你可以确定你的WordPress主题仍然在你的控制之中，而并没有被一些不安全的源代码充斥。

1.当你的新文章通过RSS发布时，控制它



问题： 你有没有过当发表文章时突然发现了一个错误？当然，你可以编辑它，但是还有个问题：这篇文章已经在你的RSS  feed里发布了。为了避免这样的问题，使用下面的代码来给文章发布和发布到RSS feed之间创建一个延迟。
解决方案：复制下面的代码到你的主题的functions.php文件中来应用修改。如果你的主题不包含这个文件，创建即可。
 

function publish_later_on_feed($where) {
global $wpdb;
if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate(&#8216;Y-m-d H:i:s&#8217;);
// value for wait; + device
$wait = &#8216;5&#8242;; // integer
// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = &#8216;MINUTE&#8217;; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
// add SQL-sytax to default $where
$where .= &#8221; AND TIMESTAMPDIFF($device, $wpdb-&#62;posts.post_date_gmt, &#8216;$now&#8217;) &#62; $wait [...]]]></description>
			<content:encoded><![CDATA[<p>RSS是一项非常简单同时非常强大的技术。如今，RSS是Blog内容联合的事实标准，它被同时广泛应用于个人和商业环境中；比如，在Blog中。而且因为这些Blog中的很大一部分是运行于Wordpress，我们将在本文中涉及到一些（也许）相对而言不为人所知但是有用的RSS相关技巧和修改，希望藉由这些技巧可以帮助你更有效的使用RSS  — 而不用使用一些不必要和臃肿的WordPress插件。</p>
<p>让我们看看10个有用但不为人所知的Wordpress  RSS技巧。这篇文章的每个部分提出一个问题，建议一个解决方案以及对这个解决方案的解释，这样不仅解决了你的RSS相关问题，同时让你了解你究竟在做什么，据此，你可以确定你的WordPress主题仍然在你的控制之中，而并没有被一些不安全的源代码充斥。</p>
<p><span id="more-1"></span></p>
<p><strong>1.当你的新文章通过RSS发布时，控制它</strong></p>
<p><strong><img class="alignnone size-full wp-image-4" title="sm8" src="http://www.wpservice.org/wp-content/uploads/2009/02/sm8.jpg" alt="sm8" width="500" height="195" /></strong></p>
<p><strong><br />
</strong></p>
<p><strong><span style="font-weight: normal;"><strong>问题：</strong> 你有没有过当发表文章时突然发现了一个错误？当然，你可以编辑它，但是还有个问题：这篇文章已经在你的RSS  feed里发布了。为了避免这样的问题，使用下面的代码来给文章发布和发布到RSS feed之间创建一个延迟。</span></strong></p>
<p><strong><span style="font-weight: normal;"><strong>解决方案：</strong>复制下面的代码到你的主题的functions.php文件中来应用修改。如果你的主题不包含这个文件，创建即可。</span></strong></p>
<p><strong> </strong></p>
<blockquote><p><span style="font-weight: normal;"><br />
function publish_later_on_feed($where) {<br />
global $wpdb;<br />
if ( is_feed() ) {<br />
// timestamp in WP-format<br />
$now = gmdate(&#8216;Y-m-d H:i:s&#8217;);<br />
// value for wait; + device<br />
$wait = &#8216;5&#8242;; // integer<br />
// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff<br />
$device = &#8216;MINUTE&#8217;; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR<br />
// add SQL-sytax to default $where<br />
$where .= &#8221; AND TIMESTAMPDIFF($device, $wpdb-&gt;posts.post_date_gmt, &#8216;$now&#8217;) &gt; $wait &#8220;;<br />
}<br />
return $where;<br />
}<br />
add_filter(&#8216;posts_where&#8217;, &#8216;publish_later_on_feed&#8217;);</span></p></blockquote>
<p><strong>代码解释：</strong><br />
上面的代码会在文章发布到Blog和出现在RSS  feed之间制造一个5分钟的延迟。如果你想修改延时的长短，请修改第九行的$wait的值。<br />
<strong></strong></p>
<p><strong>来源：<a href="http://wpengineer.com/publish-the-feed-later/">Publish your feed  later</a></strong></p>
<p><strong> </strong></p>
<p>2. 将Wordpress Feed重定向到FeedBurner Feeds上。</p>
<p><img class="alignnone size-full wp-image-5" title="sm1" src="http://www.wpservice.org/wp-content/uploads/2009/02/sm1.png" alt="sm1" width="500" height="160" /></p>
<p><span style="font-weight: normal;"><strong>问题：</strong>初级Blogger们常常是这样的：通常只有在他们看到很多其他Blog都在使用FeedBurner的服务，和认识到这个工具是多么有用和酷之后才会使用它。  他们注册和开始使用FeedBurner，但是他们的早期读者们却已经订阅了WordPress缺省的Feed。</span></p>
<p><span style="font-weight: normal;"><strong>另一个问题: </strong>你经常修改你的主题吗？如果答案是”是”，你肯定厌倦了把每个bloginfo(’rss2_url’)都替换为你的FeedBurner  Feed地址的工作。</span></p>
<p><span style="font-weight: normal;"><strong>解决方案：</strong>对上述两个问题的解决方案很简单：使用服务器重定向。</span></p>
<p><span style="font-weight: normal;">1. 创建你的.htaccess文件备份，它在你的服务器的根目录。<br />
2.  编辑.htaccess文件并添加下面的代码。别忘了把代码中的Feed地址替换成你自己的。</span></p>
<blockquote><p><span style="font-weight: normal;"># temp redirect wordpress content feeds to feedburner<br />
RewriteEngine on<br />
RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]<br />
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]<br />
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/wprecipes [R=302,NC,L]</span></p></blockquote>
<p><strong>代码解释:</strong> 每当有人点击指向  “http://www.yourblog.com/feed的链接时，他/她会被重定向到http://feeds.feedburner.com  /yourblog。这样你就永远不会丢失你的RSS订阅者，或者即使你一天修改你的主题两次，也不用再手工编辑你的RSS feed地址了。</p>
<p>来源：<a href="http://perishablepress.com/press/2008/03/25/redirect-wordpress-feeds-to-feedburner-via-htaccess-redux/">Redirect  WordPress feeds to FeedBurner via htaccess (Redux)</a></p>
<p><strong>3. 添加广告（或任何内容）到你的RSS Feed</strong></p>
<p><strong><img class="alignnone size-full wp-image-6" title="sm2" src="http://www.wpservice.org/wp-content/uploads/2009/02/sm2.png" alt="sm2" width="500" height="231" /></strong></p>
<p><strong><br />
</strong></p>
<p><strong><br />
</strong></p>
<p><strong><span style="font-weight: normal;"><strong>问题：</strong>让RSS  Feed赚钱现在已经成为很普通的一件事，很多blog所有者都在利用这项技术将他们的收入最大化。利用FeedBurner，你可以添加Adsense到你的Feed中，但是你需要至少500个订户并且不能再使用除了Feedburner提供的  Adsense之外的任何其他广告才能启用它。</span></strong></p>
<p><strong><span style="font-weight: normal;"><strong>解决方案：</strong>当然，还是有办法把其他的广告插入到你的RSS  feed之中的。比如，你可以专门为你的RSS订阅者准备一个指向免费Wordpress主题的链接</span></strong></p>
<p><strong><span style="font-weight: normal;">通过下面的几个简单步骤来达到这个目的:</span></strong></p>
<p><strong><span style="font-weight: normal;">1. 编辑你的主题的functions.php文件。如果你的主题不包含这个文件，创建之。<br />
2.  将下面的代码复制到你的functions.php文件中： </span></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong> </strong></p>
<blockquote><p><span style="font-weight: normal;"><br />
【a href=&#8221;http://www.wprecipes.com&#8221;】Have you visited WpRecipes today?【hr /】&#8217;;<br />
return $content;<br />
}<br />
add_filter(&#8216;the_excerpt_rss&#8217;, &#8216;insertAds&#8217;);<br />
add_filter(&#8216;the_content_rss&#8217;, &#8216;insertAds&#8217;);<br />
?&gt;</span></p></blockquote>
<p>3.保存文件。现在你就可以在你的RSS feed中显示广告啦！</p>
<p><strong>代码解释:</strong> 我见到过很多类似的修改，但是它们全部需要你编辑WordPress的核心文件来达到同样的效果。当然，编辑WordPress核心文件是个非常不好的主意，因为你需要在每次升级Blog之后再次编辑这些文件。而这次的这个替代方案使用了add_filter()  这个Wordpress功能来向RSS feed中插入内容，而不用编辑任何核心文件。</p>
<p>来源：<a href="http://www.wprecipes.com/how-to-insert-ads-on-your-rss-feed">How  to: insert ads in your RSS feed</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpservice.org/2009/02/18/wordpress-in-10-useful-skills-and-modify-rss-1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
