WordPress: WordPress Feeds:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: ==Introduction to Feeds== A feed is a function of special software that allows '''feedreaders''' to access a site, automatically looking for new content and t...)
 
无编辑摘要
第4行: 第4行:


There are several different kinds of feeds, read by different feedreaders.  Some feeds include RSS (alternately defined as "Rich Site Summary" or "Really Simple Syndication"), Atom or RDF files.
There are several different kinds of feeds, read by different feedreaders.  Some feeds include RSS (alternately defined as "Rich Site Summary" or "Really Simple Syndication"), Atom or RDF files.
==Feeds的介绍==
[[WordPress:Glossary#Feed|feed]]是特殊软件的一种功能,允许'''feed阅读器'''进入一个网站,自动的寻找新的内容,然后把新的内容更新信息帖在另外一个站点上 。这给使用者提供了一种与不同站点上最新和最热门的信息保持一致的方法。
有几种不同的feed,使用不同的feed阅读器。一些feed中包括了RSS(即"Rich Site Summary" 或者叫做 "Really Simple Syndication"),Atom或者RDF文件。


==WordPress Built-in Feeds==
==WordPress Built-in Feeds==


By default, WordPress comes with various feeds. They are generated by template tag for  [[WordPress:Template_Tags/bloginfo|<tt>bloginfo()</tt>]] for each type of feed and are typically listed in the sidebar and/or footer of most WordPress Themes.  They look like this:
By default, WordPress comes with various feeds. They are generated by template tag for  [[WordPress:Template_Tags/bloginfo|<tt>bloginfo()</tt>]] for each type of feed and are typically listed in the sidebar and/or footer of most WordPress Themes.  They look like this:
;URL for [http://purl.org/rss/1.0/  RDF/RSS 1.0 feed] :<tt>&lt;?php bloginfo('rdf_url'); ?></tt>
;URL for [http://www.rssboard.org/rss-0-9-2 RSS 0.92 feed] :<tt>&lt;?php bloginfo('rss_url'); ?></tt>
;URL for [http://www.rssboard.org/rss-specification RSS 2.0 feed] :<tt>&lt;?php bloginfo('rss2_url'); ?></tt>
;URL for [http://www.atomenabled.org/ Atom feed] :<tt>&lt;?php bloginfo('atom_url'); ?></tt>
;URL for comments RSS 2.0 feed :<tt>&lt;?php bloginfo('comments_rss2_url'); ?></tt>
==WordPress内置 Feeds==
默认情况下,WordPress自带有几种feed,它们由模板标签为[[WordPress:Template_Tags/bloginfo|<tt>bloginfo()</tt>]]、各种feed生成,然后在边栏或者大多数WordPress页脚列出。


;URL for [http://purl.org/rss/1.0/  RDF/RSS 1.0 feed] :<tt>&lt;?php bloginfo('rdf_url'); ?></tt>
;URL for [http://purl.org/rss/1.0/  RDF/RSS 1.0 feed] :<tt>&lt;?php bloginfo('rdf_url'); ?></tt>
第20行: 第39行:


The first four feeds display recent updates and changes to your site's content for the different feedreaders.  Of these, the RSS feeds are the most well known. The last feed example is used by RSS 2.0 feedreaders and does not show your site's content. It only shows the comments made on your site.
The first four feeds display recent updates and changes to your site's content for the different feedreaders.  Of these, the RSS feeds are the most well known. The last feed example is used by RSS 2.0 feedreaders and does not show your site's content. It only shows the comments made on your site.
前四种Feed为不同的feed阅读器列出了最新的网站上的内容改动,这几种当中,RSS feed是最著名的。最新的feed实例就使用的就是RSS 2.0 feed阅读器,它不显示网站的内容,只显示网站上的评论。


To track the comments on a specific post, the [[WordPress:Template_Tags/comments_rss_link|<tt>comments_rss_link()</tt>]] template tag is used on single post pages like this:
To track the comments on a specific post, the [[WordPress:Template_Tags/comments_rss_link|<tt>comments_rss_link()</tt>]] template tag is used on single post pages like this:
第26行: 第47行:


There are ways to modify these feeds, and these are covered in the article on [[WordPress:Customizing Feeds]].
There are ways to modify these feeds, and these are covered in the article on [[WordPress:Customizing Feeds]].
想要寻找某个帖中的评论, [[WordPress:Template_Tags/comments_rss_link|<tt>comments_rss_link()</tt>]] 模板标签可以这样使用:
<?php comments_rss_link('RSS 2.0'); ?>
有好几种方法来修改这些feed,这些都包含在[[WordPress:Customizing Feeds|自定义feed]]的文章中。


==Finding Your Feed URL==
==Finding Your Feed URL==
第55行: 第82行:
  <nowiki>http://example.com/wp-rss2.php?cat=42
  <nowiki>http://example.com/wp-rss2.php?cat=42
or
or
http://example.com/category/categoryname/feed</nowiki>
==寻找你的 Feed 连接==
你可能多次的想告诉别人你的站点的feed地址或者连接,或者你需要提交它们给搜索引擎和地址目录,其中很多都接受feed连接提交。你的每个feed都有四种可能的连接。其中任一种都可以使用。
<pre>http://example.com/wp-rss.php
http://example.com/wp-rss2.php
http://example.com/wp-rdf.php
http://example.com/wp-atom.php</pre>
你也可以这样进入连接:
<pre>http://example.com/?feed=rss
http://example.com/?feed=rss2
http://example.com/?feed=rdf
http://example.com/?feed=atom</pre>
如果你正在使用定制[[WordPress:Using Permalinks|友好连接]], 你可以通过这种方法进入下列连接:
<pre>http://example.com/feed/
http://example.com/feed/rss/
http://example.com/feed/rss2/
http://example.com/feed/rdf/
http://example.com/feed/atom/</pre>
你也可以通过添加下面的内容到连接末尾,提供feed给你网站上的特别分类:
<nowiki>http://example.com/wp-rss2.php?cat=42
http://example.com/category/categoryname/feed</nowiki>
http://example.com/category/categoryname/feed</nowiki>


第73行: 第130行:
</div>
</div>


==添加Feed==
不是所有的WordPress主题功能和所有的RSS Feed读可以通过WordPress得到的。要添加一个feed到你的网站,要先找到其他的feed在什么地方,尤其是在你的主题中的<tt>sidebar.php</tt> 和 <tt>footer.php</tt>模板文件,然后把上述列出的标签加入,如下
<div style="border:1px solid darkslateblue;padding: 5px; background: #f0f0f0">
<tt>&lt;li&gt;<br />
&lt;a href="&lt;?php bloginfo('rss2_url'); ?&gt;" title="&lt;?php _e('Syndicate this site using RSS'); ?&gt;"&gt;&lt;?php _e('&lt;abbr title="Really Simple Syndication"&gt;RSS&lt;/abbr&gt;'); ?&gt;&lt;/a&gt;
<br />&lt;/li&gt;<br /><br />
&lt;li&gt;<br />
&lt;a href="&lt;?php bloginfo('atom_url'); ?&gt;" title="&lt;?php _e('Syndicate this site using Atom'); ?&gt;"&gt;&lt;?php _e('Atom'); ?&gt;&lt;/a&gt;<br />
&lt;/li&gt;<br /><br />
&lt;li&gt;
<br />&lt;a href="&lt;?php bloginfo('comments_rss2_url'); ?&gt;" title="&lt;?php _e('The latest comments to all posts in RSS'); ?&gt;"&gt;&lt;?php _e('Comments &lt;abbr title="Really Simple Syndication"&gt;RSS&lt;/abbr&gt;'); ?&gt;&lt;/a&gt;<br />
&lt;/li&gt;</tt>
</div>


===Adding Graphics to Feed Links===
===Adding Graphics to Feed Links===


Many people like to have a graphic representing the feed instead of words.  There are now [http://www.feedicons.com/ standards] for these graphics or "buttons", but you can [http://kalsey.com/tools/buttonmaker/ make your own] to match the look and colors on your site. [[WordPress:Image:rssfeed.gif]]   
Many people like to have a graphic representing the feed instead of words.  There are now [http://www.feedicons.com/ standards] for these graphics or "buttons", but you can [http://kalsey.com/tools/buttonmaker/ make your own] to match the look and colors on your site. [[WordPress:Image:rssfeed.gif]]   
===添加图片到 Feed 连接===
很多人喜欢图片而不喜欢文字。现在有这些图片或者是"按钮"的 [http://www.feedicons.com/ 标准],但是你可以[http://kalsey.com/tools/buttonmaker/ 制作你自己的]来满足你的网站的外观和颜色. [[WordPress:Image:rssfeed.gif]]


To add a graphic to your feed link, simply wrap the link around the graphic such as:
To add a graphic to your feed link, simply wrap the link around the graphic such as:
第89行: 第165行:


[http://www.feedicons.com/ Feed Icons] provides many <span style="font-style:italic;">official</span> RSS icons in many formats (AI, EPS, SVG, PSD, PDF, PNG, JPG, GIF).
[http://www.feedicons.com/ Feed Icons] provides many <span style="font-style:italic;">official</span> RSS icons in many formats (AI, EPS, SVG, PSD, PDF, PNG, JPG, GIF).
要想加入图片到你的feed连接,可以简单的把连接用图片包围起来:
<div style="border:1px solid darkslateblue;padding: 5px; background: #f0f0f0">
<tt>&lt;a href=&quot;&lt;?php bloginfo(&#039;rss2_url&#039;); ?&gt;&quot; title=&quot;&lt;?php _e(&#039;Syndicate this site using RSS&#039;); ?&gt;&quot;&gt;<br />
&lt;img src=&quot;<nowiki>http://www.mozilla.org/images/feed-icon-14x14.png</nowiki>&quot; alt=&quot;RSS Feed&quot; title=&quot;RSS Feed&quot; /&gt;<br />
&lt;/a&gt;
</tt></div>
[http://www.semiologic.com/software/subscribe-me/ 提交我] 允许你简便的添加各种提交按钮到边栏中.
[http://www.feedicons.com/ Feed Icons] 提供了很多<span style="font-style:italic;">official</span> 各种格式的RSS 图标(AI, EPS, SVG, PSD, PDF, PNG, JPG, GIF).


===Changing Addresses===
===Changing Addresses===


If you are currently using other webblog software and are changing to WordPress, or are moving your weblog to a new location, you can "forward" RSS readers to your new RSS feeds using file rewrites and redirects in your .htaccess file.
If you are currently using other webblog software and are changing to WordPress, or are moving your weblog to a new location, you can "forward" RSS readers to your new RSS feeds using file rewrites and redirects in your .htaccess file.
===改变地址===
如果你正在使用网络博客并使用WordPress,或者正把你的网络博客迁往另外一个地址,你可以使用.htaccess文件中的文件重写和重定向把RSS阅读器"指向"你的新RSSfeed地址.


Edit the .htaccess file in your root folder, if no file exists, create one.
Edit the .htaccess file in your root folder, if no file exists, create one.


Here is an example for a b2 feed:
编辑根目录路下的.htaccess文件,如果没有这个文件就创建一个.
 
一个 b2 feed的例子:


  RewriteRule ^b2rss2.php(.*)? /wordpress/?feed=rss2 [QSA]
  RewriteRule ^b2rss2.php(.*)? /wordpress/?feed=rss2 [QSA]


Here is an example for MovableType Users:
这是一个可移除型的使用者的例子:


  RewriteRule ^index.xml(.*)? /wordpress/?feed=rss2 [QSA]
  RewriteRule ^index.xml(.*)? /wordpress/?feed=rss2 [QSA]


[http://boren.nu/archives/2005/03/29/feed-director-plugin/ Feed Director] provides rewrite rules for common feed filenames used by other blogging platforms, such as <tt>index.xml</tt>, <tt>index.rdf</tt>, <tt>rss.xml</tt>, <tt>rss2.xml</tt>, <tt>atom.xml</tt>, <tt>*.xml</tt>, via an easy-to-use "install it and forget it" plugin.
[http://boren.nu/archives/2005/03/29/feed-director-plugin/ Feed Director] provides rewrite rules for common feed filenames used by other blogging platforms, such as <tt>index.xml</tt>, <tt>index.rdf</tt>, <tt>rss.xml</tt>, <tt>rss2.xml</tt>, <tt>atom.xml</tt>, <tt>*.xml</tt>, via an easy-to-use "install it and forget it" plugin.
[http://boren.nu/archives/2005/03/29/feed-director-plugin/ Feed 指导]通过其他的博客平台提供了普通feed文件名的重写规则,如<tt>index.xml</tt>, <tt>index.rdf</tt>, <tt>rss.xml</tt>, <tt>rss2.xml</tt>, <tt>atom.xml</tt>, <tt>*.xml</tt>, 通过易用的"install it and forget it"插件.


==More Information and Resources==
==More Information and Resources==
==更多信息和资源==


* [[WordPress:Customizing Feeds]]
* [[WordPress:Customizing Feeds]]
第121行: 第219行:
* [http://codex.wordpress.org/Using_FeedBurner Using FeedBurner with WordPress]
* [http://codex.wordpress.org/Using_FeedBurner Using FeedBurner with WordPress]
* [http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html Changing feed url with .htaccess]
* [http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html Changing feed url with .htaccess]
* [[WordPress:Customizing Feeds|Feed自定义]]
* [http://wordlog.com/archives/2004/08/01/add-an-image-to-your-rss-20-field/ 如何添加图片到RSS2.0 feed]
* [http://perishablepress.com/press/2007/02/04/feed-your-image-via-atom-or-rss/ 如何添加图片到RSS and Atom feeds ]
* [http://perishablepress.com/press/2006/11/20/add-rss-feed-link-icons/ 添加 RSS feed 连接图标到WordPress分类]
* [http://www.mezzoblue.com/archives/2004/05/19/what_is_rssx/ Mezzoblue's 什么是RSS/XML/Atom/Syndication?]
* [http://www.newsforge.com/article.pl?sid=04/08/19/1420241 NewsForge: 用syndication节省时间]
* [http://feedicons.com/ Feed Icons – 帮助建立新标准]
* [http://kalsey.com/tools/buttonmaker/ Kalsey's 按钮设计器 – 定义Feed图标]
* [http://www.lucazappa.com/brilliantMaker/buttonImage.php 80x15 Brilliant Button Maker]
* [http://www.netdenizen.com/buttonmill/glassy.php Glassy Button Maker]
* [http://www.yugatech.com/make.php Online Button Maker]
* [http://codex.wordpress.org/Using_FeedBurner 在WordPress 中使用FeedBurner]
* [http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html 通过.htaccess改变feed连接]

2008年4月10日 (四) 14:53的版本

Introduction to Feeds

A feed is a function of special software that allows feedreaders to access a site, automatically looking for new content and then posting the information about new content and updates to another site. This provides a way for users to keep up with the latest and hottest information posted on different blogging sites.

There are several different kinds of feeds, read by different feedreaders. Some feeds include RSS (alternately defined as "Rich Site Summary" or "Really Simple Syndication"), Atom or RDF files.

Feeds的介绍

feed是特殊软件的一种功能,允许feed阅读器进入一个网站,自动的寻找新的内容,然后把新的内容更新信息帖在另外一个站点上 。这给使用者提供了一种与不同站点上最新和最热门的信息保持一致的方法。

有几种不同的feed,使用不同的feed阅读器。一些feed中包括了RSS(即"Rich Site Summary" 或者叫做 "Really Simple Syndication"),Atom或者RDF文件。

WordPress Built-in Feeds

By default, WordPress comes with various feeds. They are generated by template tag for bloginfo() for each type of feed and are typically listed in the sidebar and/or footer of most WordPress Themes. They look like this:

URL for RDF/RSS 1.0 feed
<?php bloginfo('rdf_url'); ?>
URL for RSS 0.92 feed
<?php bloginfo('rss_url'); ?>
URL for RSS 2.0 feed
<?php bloginfo('rss2_url'); ?>
URL for Atom feed
<?php bloginfo('atom_url'); ?>
URL for comments RSS 2.0 feed
<?php bloginfo('comments_rss2_url'); ?>

WordPress内置 Feeds

默认情况下,WordPress自带有几种feed,它们由模板标签为bloginfo()、各种feed生成,然后在边栏或者大多数WordPress页脚列出。

URL for RDF/RSS 1.0 feed
<?php bloginfo('rdf_url'); ?>
URL for RSS 0.92 feed
<?php bloginfo('rss_url'); ?>
URL for RSS 2.0 feed
<?php bloginfo('rss2_url'); ?>
URL for Atom feed
<?php bloginfo('atom_url'); ?>
URL for comments RSS 2.0 feed
<?php bloginfo('comments_rss2_url'); ?>

The first four feeds display recent updates and changes to your site's content for the different feedreaders. Of these, the RSS feeds are the most well known. The last feed example is used by RSS 2.0 feedreaders and does not show your site's content. It only shows the comments made on your site.

前四种Feed为不同的feed阅读器列出了最新的网站上的内容改动,这几种当中,RSS feed是最著名的。最新的feed实例就使用的就是RSS 2.0 feed阅读器,它不显示网站的内容,只显示网站上的评论。

To track the comments on a specific post, the comments_rss_link() template tag is used on single post pages like this:

<?php comments_rss_link('RSS 2.0'); ?>

There are ways to modify these feeds, and these are covered in the article on WordPress:Customizing Feeds.

想要寻找某个帖中的评论, comments_rss_link() 模板标签可以这样使用:

<?php comments_rss_link('RSS 2.0'); ?>

有好几种方法来修改这些feed,这些都包含在自定义feed的文章中。

Finding Your Feed URL

There are times when you want to tell someone your site's feed address or URL, or you need it to submit it to search engines and directories, many of which now accept feed URL submissions. There are four possible URLs for each of your feeds. Any of these will work.

http://example.com/wp-rss.php
http://example.com/wp-rss2.php
http://example.com/wp-rdf.php
http://example.com/wp-atom.php

Or you can access them like this:

http://example.com/?feed=rss
http://example.com/?feed=rss2
http://example.com/?feed=rdf
http://example.com/?feed=atom

If you are using custom permalinks, you should be able to reach them through this usage:

http://example.com/feed/
http://example.com/feed/rss/
http://example.com/feed/rss2/
http://example.com/feed/rdf/
http://example.com/feed/atom/

You can also provide feeds to only specific categories on your site by adding the following to the end of the link:

http://example.com/wp-rss2.php?cat=42
or
http://example.com/category/categoryname/feed

寻找你的 Feed 连接

你可能多次的想告诉别人你的站点的feed地址或者连接,或者你需要提交它们给搜索引擎和地址目录,其中很多都接受feed连接提交。你的每个feed都有四种可能的连接。其中任一种都可以使用。

http://example.com/wp-rss.php
http://example.com/wp-rss2.php
http://example.com/wp-rdf.php
http://example.com/wp-atom.php

你也可以这样进入连接:

http://example.com/?feed=rss
http://example.com/?feed=rss2
http://example.com/?feed=rdf
http://example.com/?feed=atom

如果你正在使用定制友好连接, 你可以通过这种方法进入下列连接:

http://example.com/feed/
http://example.com/feed/rss/
http://example.com/feed/rss2/
http://example.com/feed/rdf/
http://example.com/feed/atom/

你也可以通过添加下面的内容到连接末尾,提供feed给你网站上的特别分类:

http://example.com/wp-rss2.php?cat=42
或
http://example.com/category/categoryname/feed

Adding Feeds

Not all WordPress Themes feature all of the RSS Feed types that are available through WordPress. To add a feed to your site, find the location of where the other feeds are, typically in your sidebar.php or footer.php template files of your Theme. Then add one of the tags listed above to the list, like this example:

<li>
<a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a>
</li>

<li>
<a href="<?php bloginfo('atom_url'); ?>" title="<?php _e('Syndicate this site using Atom'); ?>"><?php _e('Atom'); ?></a>
</li>

<li>
<a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a>
</li>

添加Feed

不是所有的WordPress主题功能和所有的RSS Feed读可以通过WordPress得到的。要添加一个feed到你的网站,要先找到其他的feed在什么地方,尤其是在你的主题中的sidebar.phpfooter.php模板文件,然后把上述列出的标签加入,如下

<li>
<a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a>
</li>

<li>
<a href="<?php bloginfo('atom_url'); ?>" title="<?php _e('Syndicate this site using Atom'); ?>"><?php _e('Atom'); ?></a>
</li>

<li>
<a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a>
</li>

Adding Graphics to Feed Links

Many people like to have a graphic representing the feed instead of words. There are now standards for these graphics or "buttons", but you can make your own to match the look and colors on your site. WordPress:Image:rssfeed.gif

添加图片到 Feed 连接

很多人喜欢图片而不喜欢文字。现在有这些图片或者是"按钮"的 标准,但是你可以制作你自己的来满足你的网站的外观和颜色. WordPress:Image:rssfeed.gif

To add a graphic to your feed link, simply wrap the link around the graphic such as:

<a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>">
<img src="http://www.mozilla.org/images/feed-icon-14x14.png" alt="RSS Feed" title="RSS Feed" />
</a>

Subscribe Me allows you to easily add various subscription buttons to your sidebar.

Feed Icons provides many official RSS icons in many formats (AI, EPS, SVG, PSD, PDF, PNG, JPG, GIF).

要想加入图片到你的feed连接,可以简单的把连接用图片包围起来:

<a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>">
<img src="http://www.mozilla.org/images/feed-icon-14x14.png" alt="RSS Feed" title="RSS Feed" />
</a>

提交我 允许你简便的添加各种提交按钮到边栏中.

Feed Icons 提供了很多official 各种格式的RSS 图标(AI, EPS, SVG, PSD, PDF, PNG, JPG, GIF).

Changing Addresses

If you are currently using other webblog software and are changing to WordPress, or are moving your weblog to a new location, you can "forward" RSS readers to your new RSS feeds using file rewrites and redirects in your .htaccess file.

改变地址

如果你正在使用网络博客并使用WordPress,或者正把你的网络博客迁往另外一个地址,你可以使用.htaccess文件中的文件重写和重定向把RSS阅读器"指向"你的新RSSfeed地址.

Edit the .htaccess file in your root folder, if no file exists, create one.

编辑根目录路下的.htaccess文件,如果没有这个文件就创建一个.

一个 b2 feed的例子:

RewriteRule ^b2rss2.php(.*)? /wordpress/?feed=rss2 [QSA]

这是一个可移除型的使用者的例子:

RewriteRule ^index.xml(.*)? /wordpress/?feed=rss2 [QSA]

Feed Director provides rewrite rules for common feed filenames used by other blogging platforms, such as index.xml, index.rdf, rss.xml, rss2.xml, atom.xml, *.xml, via an easy-to-use "install it and forget it" plugin.

Feed 指导通过其他的博客平台提供了普通feed文件名的重写规则,如index.xml, index.rdf, rss.xml, rss2.xml, atom.xml, *.xml, 通过易用的"install it and forget it"插件.

More Information and Resources

更多信息和资源