Make WordPress Core

source: trunk/wp-rss2.php @ 1485

Last change on this file since 1485 was 1485, checked in by rboren, 21 years ago

Do not cut excerpts in rss feeds. Patch from Kitten for bug 0000192.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1<?php
2
3if (!isset($feed) || !$feed) {
4    $blog = 1;
5    $doing_rss = 1;
6    require('wp-blog-header.php');
7}
8
9header('Content-type: text/xml', true);
10$more = 1;
11
12?>
13<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
14
15<!-- generator="wordpress/<?php echo $wp_version ?>" -->
16<rss version="2.0"
17        xmlns:content="http://purl.org/rss/1.0/modules/content/"
18        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
19>
20
21<channel>
22        <title><?php bloginfo_rss('name') ?></title>
23        <link><?php bloginfo_rss('url') ?></link>
24        <description><?php bloginfo_rss("description") ?></description>
25        <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate()); ?></copyright>
26        <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?></pubDate>
27        <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
28
29        <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
30        <item>
31                <title><?php the_title_rss() ?></title>
32                <link><?php permalink_single_rss() ?></link>
33                <comments><?php comments_link(); ?></comments>
34                <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $post->post_date_gmt, 0); ?></pubDate>
35                <?php the_category_rss() ?>
36                <guid><?php the_permalink($id); ?></guid>
37<?php if (get_settings('rss_use_excerpt')) : ?>
38                <description><?php the_excerpt_rss('', 2) ?></description>
39<?php else : ?>
40                <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
41                <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
42<?php endif; ?>
43                <wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS>
44        </item>
45        <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
46</channel>
47</rss>
Note: See TracBrowser for help on using the repository browser.