• I created a child theme with twentyten. So simple, added a css and a blank functions.php to it. Everything works fine but when I add anything in between the php tags in the functions.php and update the file i keep getting this reply:

    Warning: Cannot modify header information - headers already sent by (output started at.../public_html/mysite/wp-content/themes/practice theme/functions.php:1) in .../public_html/mysite/wp-admin/theme-editor.php on line 89

    line 89 is this:

    header("Location: $location");

    I can’t figure it out and I can’t understand the error message. I’ve tried deleting the functions.php and uploading a clean blank one and everything is ok until i save the functions.php and I get the same error message. Anybody know what’s wrong?? Thanks for the help

Viewing 6 replies - 1 through 6 (of 6 total)
  • Actually, the error is probably in the functions.php file at line 1.

    Make sure you have no blank lines or spaces before the opening php tag, and see if that takes care of the error..

    [edit] …ahhh this may be the key phrase

    uploading a clean blank one

    Use this reference for a basic functions.php file. You can paste the example in your functions file and it should load with no problem.

    Thread Starter nastycanasta

    (@nastycanasta)

    I probably should have been more clear when I upload a new php file it does have the opening and closing tags on it but it’s blank otherwise. When I put any type of code in between them, I’m still getting the error. And yes, the opening tag is right at the very top with no spaces. Any other suggestions?

    Try pasting this in it and see if the symptom changes;

    <?php
    
    function favicon_link() {
        echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />' . "\n";
    }
    add_action('wp_head', 'favicon_link');
    
    ?>

    That works perfectly for me with nothing else but the basic style.css in the directory. Beyond that, I’m stumped..

    Thread Starter nastycanasta

    (@nastycanasta)

    I actually created a new functions.php file with only opening and closing tags and then inserted your code and it worked. Then I tried putting other code and that was saved successfully too. Thanks. What do you think was causing the error?

    Interesting OLD topic relative to editing php files using UTF-8 vs ascii encoding, and how it can affect php files. Not sure if it’s any help or not, but I suppose it could be editor related…

    http://wordpress.org/support/topic/themefunctionsphp-produces-plugins-activation-error?replies=9#post-828904

    oops… nevermind! 🙂

    What do you think was causing the error?

    I like to blame these sorts of things on solar radiation or “Sun Dogs”… (puts tinfoil hat back on)

    But that’s just me.. Just one of those things. Glad you got it sorted out!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Someone please help me with functions.php please’ is closed to new replies.