Support » Fixing WordPress » …Headers already sent

  • I’m trying to create a child theme for twentyeleven. I’m creating a new (initially blank) functions.php file and keeping it inside the child theme directory. When I paste some code in that file to modify the twentyeleven functions.php file, I get the following when I update pages…
    Warning: Cannot modify header information – headers already sent by (output started at xxxxxxx/wp-content/themes/ETJchildtheme/functions.php:40) in xxxxxxxxx/wp-includes/pluggable.php on line 934

    What do I do about that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Found the answer in another post with similar title to mine:

    The problem here is that you have gotten some text or whitespace (spaces, newline) before the opening PHP tag or after the closing PHP tag in your theme’s functions.php file. There can’t be a single character before or after those tags.

    Thanks Stvwlf…wherever you are.

    Look at functions.php line 40, see what it says.

    -edit > problem fixed > nevermind-

    Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)

    What this means for child theme development is that any functions you include in your CHILD THEME functions file cannot duplicate any functions that already exist within the PARENT THEME functions.php. If you have duplicate functions, you will get the dreaded “Headers already sent” error message.

    Start with a blank functions.php file in your CHILD THEME, and the error should go away. Then, do some research on Google and in the WP Codex on modifying the functions, using hooks and such…build from there.

    Hope that helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘…Headers already sent’ is closed to new replies.