- <pubDate><?php echo gmdate('r'); ?></pubDate>
- <?php the_generator( 'rss2' ); ?>
- <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
- <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
- <?php do_action('commentsrss2_head'); ?>
-<?php
-if ( have_comments() ) : while ( have_comments() ) : the_comment();
- $comment_post = get_post($comment->comment_post_ID);
- get_post_custom($comment_post->ID);
-?>
+ <lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
+ <sy:updatePeriod><?php
+ /** This filter is documented in wp-includes/feed-rss2.php */
+ echo apply_filters( 'rss_update_period', 'hourly' );
+ ?></sy:updatePeriod>
+ <sy:updateFrequency><?php
+ /** This filter is documented in wp-includes/feed-rss2.php */
+ echo apply_filters( 'rss_update_frequency', '1' );
+ ?></sy:updateFrequency>
+ <?php
+ /**
+ * Fires at the end of the RSS2 comment feed header.
+ *
+ * @since 2.3.0
+ */
+ do_action( 'commentsrss2_head' );
+
+ if ( have_comments() ) : while ( have_comments() ) : the_comment();
+ $comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
+ ?>