• Resolved thehuzband

    (@thehuzband)


    Could someone point me in the right direction? I’m a little new to WordPress. I’m using version 2.9.2. When ever I attempt to edit the sidebar items, I get this error. Occasionally when I try to login I get the same error. The error stops when I remove the “functions.php” file, but leaves me with now sidebar functionality.

    This is the error I’m receiving and I am completely lost.

    Warning: Cannot modify header information – headers already sent by (output started at /home/samhoody/public_html/wp-content/themes/lyricalmindsmedia/functions.php:2)

Viewing 7 replies - 1 through 7 (of 7 total)
  • This suggests that you are not including the opening php tags at the start of your functions php file, or are otherwise introducing content that causes the file to send output to the browser. The functions.php should only contain functions to be called from elsewhere.

    Thread Starter thehuzband

    (@thehuzband)

    I am unsure if this helps, but this is the information included in my functions.php file…

    | <?php
    if ( function_exists(‘register_sidebar’) )
    register_sidebars(2, array(
    ‘before_widget’ => ‘<ul class=”category-bg widget %2$s”>’,
    ‘after_widget’ => ”,
    ‘before_title’ => ‘<h2>’,
    ‘after_title’ => ‘</h2>’,
    ));

    ?> |

    Remove spaces and new lines before the first <?php tag. This should fix the problem.

    Thread Starter thehuzband

    (@thehuzband)

    Probably quite simple… Please clarify. ie. Example Structure
    Thanks

    I’m not sure how much clearer he can be. Remove the spaces.

    |<?php

    Instead of

    | <?php

    Hi,

    It is usually due to spaces, new lines, or other garbage at opening/closing PHP file <?php tag or after a closing ?> tag in wp-config.php. It can be other file too so need to check error message as it may list file name where the error occurred.

    You can either upload error file from the backup or edit erroneous file. To edit the file one need to check below mentioned points:

    1. Download the file mentioned in the error message.
    2. Open that file in a plain text editor
    3. Check that the very first characters are <?php
    4. Check that the very last characters are ?>
    5. Place the cursor between the ? and >
    6. Now press the DELETE key on your computer and keep that key pressed for at least 15 seconds.
    7. Now type > and
    8. Save without pressing any other key at all.

    That’s it!

    Thanks,

    Shane G.

    Thread Starter thehuzband

    (@thehuzband)

    Thanks… Issue resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cannot modify header information – headers already sent by’ is closed to new replies.