• Hi, I just installed WordPress and now I’m not sure how to fix the following error message. I just got it while trying to upload an image. I’m using a theme I just installed, but didn’t get this message before installing this theme!

    Warning: Cannot modify header information – headers already sent by (output started at /home/myaccountname/public_html/blog/wp-content/themes/Brodie-Theme/brodie/functions.php:6) in /home/myaccountname/public_html/blog/wp-includes/pluggable.php on line 391

    Any help with this is greatly appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    The theme’s functions.php file probably has a blank line at the end of it (on line 6). Edit the file and remove that blank line. The functions.php cannot have any blank lines at the beginning or end of the file.

    Thread Starter jdessel

    (@jdessel)

    Thanks for the help, but it didn’t fix it. Line 6 of functions.php isn’t a blank line and I deleted the blank lines at the end of the document anyway, which didn’t change things. I included the code below of what’s in the general area of the lines that the error message seems to be referencing in case the lines above or below the lines indicated might shed some light on the problem:

    These are lines 1-12 in functions.php (the error seems to be line 6)

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar();
    ?>
    
    <?php
    // Produces a list of pages in the header without whitespace -- er, I mean negative space.
    function sandbox_globalnav() {
    	echo '<div id="menu"><ul>';
    	$menu = wp_list_pages('title_li=&sort_column=menu_order&echo=0'); // Params for the page list in header.php
    	echo str_replace(array("\r", "\n", "\t"), '', $menu);
    	echo "</ul></div>\n";

    These are lines 385-391 in pluggable.php (the error seems to be on line 391)

    `if ( $is_IIS ) {
    header(“Refresh: 0;url=$location”);
    } else {
    if ( php_sapi_name() != ‘cgi-fcgi’ )
    status_header($status); // This causes problems on IIS and some FastCGI setups
    header(“Location: $location”);`

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    The error is not in pluggable.php. It’s in functions.php, on line 6. You even posted the error above:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar();
    ?>
    
    <?php
    // Produces ...

    See that blank line? It’s right there, between the ?> and the <?php. It cannot be there. In fact, neither can the closing and opening PHP tags in this case.

    Change the beginning of the file to this:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar();
    
    // Produces ...

    Note how I removed not only the blank line, but the closing and opening php tags as well.

    The “line 6” is referring to the second <?php bit, which was the ending line of the output being produced by that file.

    Thread Starter jdessel

    (@jdessel)

    Thanks so much for your help, works fine now.

    The blank space was on line 5 and that’s what confused me, since it was referencing 6- especially since there are other blank lines in that document elsewhere. I thought maybe something else was going on.

    Thanks for your help, all fixed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting an error message, not sure how to fix…’ is closed to new replies.