WordPress.org

Support

Support » How-To and Troubleshooting » Cannot Modify Header Information. Help!!!!

Cannot Modify Header Information. Help!!!!

  • Hello,

    I’ve downloaded and installed this theme http://themes.wordpress.net/?s=beautiful+sunrise+1.2 on 2.3.3. Everytime I try to save or publish I get different error messages like this:

    Warning: Cannot modify header information – headers already sent by (output started at /home/bestbook/public_html/targetpublics/wp-content/themes/beautiful-sunrise-10/functions.php:72) in /home/bestbook/public_html/targetpublics/wp-includes/pluggable.php on line 390

    Is something buggy with the theme or the upgrade?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Jeremy Clark

    @jeremyclark13

    Member

    Look in theme’s function.php and then go to the end of the file and see if there is any blank lines. The easiest way is to put your cursor right after the last ?> and hold the delete key.

    Hi Jeremy.

    I did this and there doesn’t look to be like any extra lines. The cursor begins right at the ?>.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    There may not be blank lines, but there is *something* there. Your own error tells us exactly where it is:

    (output started at ...themes/beautiful-sunrise-10/functions.php:72)

    That means that line 72 of your theme’s functions.php file is generating some kind of output. Maybe it’s a space, maybe it’s a blank line. Who knows? The point is that it is there and it exists.

    Can’t find it? Use a text editor that doesn’t suck. I recommend TextPad if you use Windows.

    Hi Otto.

    I opened up the functions.php file in DreamWeaver

    the code looks like this starting at line 72:

    72<?php
    73
    74 define(‘HEADER_TEXTCOLOR’, ”);
    75 define(‘HEADER_IMAGE’, ‘%s/images/beautiful-sunrise.jpg’);
    76 define(‘HEADER_IMAGE_WIDTH’, 850);
    77 define(‘HEADER_IMAGE_HEIGHT’, 200);
    78 define( ‘NO_HEADER_TEXT’, true );
    79
    80 function admin_header_style() {
    81 ?>

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    What is immediately before line 72? Show the section surrounding that line.

    If it’s something like this:

    70 ?>
    71
    72 <?php

    Then that’s obviously your problem. However, this error is not so obvious:

    71 ?>
    72 <?php

    That’s a blank line too. Right there between the ?> and the <?php is a carriage return/line feed.

    The fix depends on what the cause is.

    Lines 70 and 71 are both blank.

    This is driving me crazy!!!

    Also, I noticed in the 2.3.3 sticky that the pluggable.php file is changed. And that file is included in the error message. ???

    Otto, please help me!!! Thanks.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    Lines 70 and 71 are both blank.

    Well, there’s your problem. What’s the first line above line 72 that’s NOT blank? We really, really need to see the relevant section to tell you how to fix it. Understand?

    Why not go to http://wordpress.pastebin.ca , paste your entire functions.php file into there, post it, and then post the link to it here. Then we can look at it ourselves and tell you how to fix it.

    Also, I noticed in the 2.3.3 sticky that the pluggable.php file is changed. And that file is included in the error message. ???

    That’s not related to this problem. The problem is absolutely in your theme’s functions.php file. This is me telling you how it is, I’m not just guessing here.

    Okay, here it is.

    http://wordpress.pastebin.ca/896638

    Thanks Otto!

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    Here’s the fixed version:
    http://wordpress.pastebin.ca/896650

    That got rid of the initial error. BUT I’m getting this now.

    Parse error: syntax error, unexpected T_DNUMBER in /home/bestbook/public_html/targetpublics/wp-content/themes/beautiful-sunrise-10/functions.php on line 5

    But Otto, I tried this… I removed everything after line 70 and walla! The error was gone and everything seems to be functioning normally.

    Was that okay to do? Here is the new code:

    http://wordpress.pastebin.ca/896669

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Cannot Modify Header Information. Help!!!!’ is closed to new replies.