root/trunk/wp-includes/feed-rss2.php

Revision 1519, 2.3 kB (checked in by donncha, 6 days ago)

WP Merge

  • Property svn:eol-style set to native
Line 
1 <?php
2 /**
3  * RSS2 Feed Template for displaying RSS2 Posts feed.
4  *
5  * @package WordPress
6  */
7
8 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
9 $more = 1;
10
11 ?>
12 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
13
14 <rss version="2.0"
15     xmlns:content="http://purl.org/rss/1.0/modules/content/"
16     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
17     xmlns:dc="http://purl.org/dc/elements/1.1/"
18     xmlns:atom="http://www.w3.org/2005/Atom"
19     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
20     <?php do_action('rss2_ns'); ?>
21 >
22
23 <channel>
24     <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
25     <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
26     <link><?php bloginfo_rss('url') ?></link>
27     <description><?php bloginfo_rss("description") ?></description>
28     <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
29     <?php the_generator( 'rss2' ); ?>
30     <language><?php echo get_option('rss_language'); ?></language>
31     <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
32     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
33     <?php do_action('rss2_head'); ?>
34     <?php while( have_posts()) : the_post(); ?>
35     <item>
36         <title><?php the_title_rss() ?></title>
37         <link><?php the_permalink_rss() ?></link>
38         <comments><?php comments_link(); ?></comments>
39         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
40         <dc:creator><?php the_author() ?></dc:creator>
41         <?php the_category_rss() ?>
42
43         <guid isPermaLink="false"><?php the_guid(); ?></guid>
44 <?php if (get_option('rss_use_excerpt')) : ?>
45         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
46 <?php else : ?>
47         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
48     <?php if ( strlen( $post->post_content ) > 0 ) : ?>
49         <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
50     <?php else : ?>
51         <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
52     <?php endif; ?>
53 <?php endif; ?>
54         <wfw:commentRss><?php echo get_post_comments_feed_link(); ?></wfw:commentRss>
55 <?php rss_enclosure(); ?>
56     <?php do_action('rss2_item'); ?>
57     </item>
58     <?php endwhile; ?>
59 </channel>
60 </rss>
61
Note: See TracBrowser for help on using the browser.