Set up the post global variable in the comment feed loops so that any calls to post related template tags work correctly.

Ensures that atom feeds show threading for top-level comments correctly.
Fixes #14908 props solarissmoke and SergeyBiryukov.

git-svn-id: https://develop.svn.wordpress.org/trunk@18716 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2011-09-19 12:39:59 +00:00
parent 814faf7f4f
commit 442590c211
2 changed files with 2 additions and 4 deletions

View File

@ -42,8 +42,7 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'
<?php do_action('comments_atom_head'); ?>
<?php
if ( have_comments() ) : while ( have_comments() ) : the_comment();
$comment_post = get_post($comment->comment_post_ID);
get_post_custom($comment_post->ID);
$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
?>
<entry>
<title><?php

View File

@ -34,8 +34,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
<?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);
$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
?>
<item>
<title><?php