Make WordPress Core

Ticket #1114: wp-rss2.php

File wp-rss2.php, 2.2 KB (added by anonymousbugger, 19 years ago)
Line 
11 <?php
22 if (empty($feed)) {
33       $blog = 1;
44       $feed = 'rss2';
55       $doing_rss = 1;
66       require('wp-blog-header.php');
77 }
8
98 header('Content-type: application/xml; charset=' . get_settings('blog_charset'), true);
109 $more = 1;
11
1210 ?>
1311 <?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
14
1512 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" -->
1613 <rss version="2.0"
1714      xmlns:content="http://purl.org/rss/1.0/modules/content/"
1815      xmlns:wfw="http://wellformedweb.org/CommentAPI/"
1916      xmlns:dc="http://purl.org/dc/elements/1.1/"
2017 >
21
2218 <channel>
2319      <title><?php bloginfo_rss('name'); ?></title>
2420      <link><?php bloginfo_rss('url') ?></link>
2521      <description><?php bloginfo_rss("description") ?></description>
2622      <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?></pubDate>
2723      <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
2824      <language><?php echo get_option('rss_language'); ?></language>
29
3025      <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
3126      <item>
3227              <title><?php the_title_rss() ?></title>
3328              <link><?php permalink_single_rss() ?></link>
3429              <comments><?php comments_link(); ?></comments>
3530              <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_the_time('Y-m-d H:i:s')); ?></pubDate>
3631              <dc:creator><?php the_author() ?></dc:creator>
3732              <?php the_category_rss() ?>
38
3933              <guid><?php the_permalink($id); ?></guid>
4034 <?php if (get_settings('rss_use_excerpt')) : ?>
4135              <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
4236 <?php else : ?>
4337              <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
4438      <?php if ( strlen( $post->post_content ) > 0 ) : ?>
4539              <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
4640      <?php else : ?>
4741              <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
4842      <?php endif; ?>
4943 <?php endif; ?>
5044              <wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS>
5145 <?php rss_enclosure(); ?>
5246      </item>
5347      <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
5448 </channel>
5549 </rss>
56