Cannot modify header information – headers already sent
-
Hello,
I have been editing functions.php to customise my comments section, and the styling is working fine, however now whenever someone posts a comment, the following error comes up:
Warning: Cannot modify header information – headers already sent by (output started at /blog/wp-content/themes/ransom/functions.php:442) in /blog/wp-includes/pluggable.php on line 890
I haven’t tampered with pluggable.php at all, but here is line 442 of functions.php, which is where I’ve been working on the custom comment:
<?php //this function will be called in the next section function advanced_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div class="comment_post_wrap"> <div class="comment_post_left"> <?php echo get_avatar($comment,$size='100',$default='<path_to_url>' ); ?><br /> <a href="<?php the_author_meta( 'user_url'); ?>"><?php printf(__('%s'), get_comment_author_link()) ?></a><br /> <?php printf(get_comment_date()) ?> </div> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.') ?></em> <br /> <?php endif; ?> <div class="blog_post_right"> <?php comment_text() ?> </div> </div> </li> <div class="comment_divider"></div> <?php } ?>
How would I correct the problem? Any ideas why it’s happening?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Cannot modify header information – headers already sent’ is closed to new replies.