WordPress.org

Ready to get started?Download WordPress

Forums

Cannot Modify Header Information. Help!!!! (11 posts)

  1. BestBooks
    Member
    Posted 6 years ago #

    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?

  2. Jeremy Clark
    Moderator
    Posted 6 years ago #

    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.

  3. BestBooks
    Member
    Posted 6 years ago #

    Hi Jeremy.

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

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    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.

  5. BestBooks
    Member
    Posted 6 years ago #

    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 ?>

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    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.

  7. BestBooks
    Member
    Posted 6 years ago #

    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.

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    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.

  9. BestBooks
    Member
    Posted 6 years ago #

    Okay, here it is.

    http://wordpress.pastebin.ca/896638

    Thanks Otto!

  10. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

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

  11. BestBooks
    Member
    Posted 6 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic