3 * RSS2 Feed Template for displaying RSS2 Posts feed.
8 header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
14 xmlns:content="http://purl.org/rss/1.0/modules/content/"
15 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
16 xmlns:dc="http://purl.org/dc/elements/1.1/"
17 xmlns:atom="http://www.w3.org/2005/Atom"
18 xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
19 xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
22 * Fires at the end of the RSS root to add namespaces.
26 do_action( 'rss2_ns' );
31 <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
32 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
33 <link><?php bloginfo_rss('url') ?></link>
34 <description><?php bloginfo_rss("description") ?></description>
35 <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
36 <language><?php bloginfo_rss( 'language' ); ?></language>
40 * Filter how often to update the RSS feed.
44 * @param string $duration The update period.
45 * Default 'hourly'. Accepts 'hourly', 'daily', 'weekly', 'monthly', 'yearly'.
48 <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', $duration ); ?></sy:updatePeriod>
52 * Filter the RSS update frequency.
56 * @param string $frequency An integer passed as a string representing the frequency
57 * of RSS updates within the update period. Default '1'.
60 <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', $frequency ); ?></sy:updateFrequency>
63 * Fires at the end of the RSS2 Feed Header.
67 do_action( 'rss2_head');
69 while( have_posts()) : the_post();
72 <title><?php the_title_rss() ?></title>
73 <link><?php the_permalink_rss() ?></link>
74 <comments><?php comments_link_feed(); ?></comments>
75 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
76 <dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
77 <?php the_category_rss('rss2') ?>
79 <guid isPermaLink="false"><?php the_guid(); ?></guid>
80 <?php if (get_option('rss_use_excerpt')) : ?>
81 <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
83 <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
84 <?php $content = get_the_content_feed('rss2'); ?>
85 <?php if ( strlen( $content ) > 0 ) : ?>
86 <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
88 <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
91 <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
92 <slash:comments><?php echo get_comments_number(); ?></slash:comments>
93 <?php rss_enclosure(); ?>
96 * Fires at the end of each RSS2 feed item.
100 do_action( 'rss2_item' );