• Resolved cherylweb27

    (@cherylweb27)


    I’ve loaded the theme onto a fresh new install of WordPress. I then loaded my own child theme (style.css and functions.php, both with no theme modifications), and got the following error:

    Warning: Cannot modify header information – headers already sent by (output started at /home2/cheryl27/public_html/notsoalternateideas.com/wp-content/themes/Mesocolumn Child Theme/functions.php:6) in /home2/cheryl27/public_html/notsoalternateideas.com/wp-includes/pluggable.php on line 1228

    (Or something similar… the “on line xxx” might have been different, but everything else was the same.)

    So then I deleted my child theme (the error went away), and loaded the theme-provided child theme. With ONLY the theme-provided child theme, there were no errors.

    Then I created a “blank” functions.php, with only the following in it:

    <?php
    // Your php code goes here
    ?>

    and the error returned (this is the current “on line xxx” error):

    Warning: Cannot modify header information – headers already sent by (output started at /home2/cheryl27/public_html/notsoalternateideas.com/wp-content/themes/Mesocolumn Child Theme/functions.php:6) in /home2/cheryl27/public_html/notsoalternateideas.com/wp-includes/pluggable.php on line 1228

    What’s going on? How can I include a functions.php in my child theme?

    Site Link: https://notsoalternateideas.com/

    Thanks for the help! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author Richie KS

    (@rkcorp)

    probably the theme folder name ‘Mesocolumn Child Theme’
    try rename it to mesocolumn-child-theme

    Thread Starter cherylweb27

    (@cherylweb27)

    Where do you see that? When I look at my site’s files via cPanel & File Manager, I see the following path:

    wp-content >> themes >> mesocolumn-child

    Do I need to reinstall the child theme, and adjust the folder name before uploading?

    Thread Starter cherylweb27

    (@cherylweb27)

    Ohhhh…. I see it in the path of the error…. but I don’t know where that’s coming from??? That was the original child theme that I deleted.

    Thread Starter cherylweb27

    (@cherylweb27)

    Sorry for the confusion! I think I might have cut & pasted the wrong error.

    THIS IS THE CURRENT ERROR…

    Warning: Cannot modify header information – headers already sent by (output started at /home2/cheryl27/public_html/notsoalternateideas.com/wp-content/themes/mesocolumn-child/functions.php:4) in /home2/cheryl27/public_html/notsoalternateideas.com/wp-includes/option.php on line 820

    Warning: Cannot modify header information – headers already sent by (output started at /home2/cheryl27/public_html/notsoalternateideas.com/wp-content/themes/mesocolumn-child/functions.php:4) in /home2/cheryl27/public_html/notsoalternateideas.com/wp-includes/option.php on line 821

    (I never would have caught that if you hadn’t mentioned the folder name. Good catch! Sorry for the confusion. ?? )

    what editor are you using to create the new functions.php file?
    there must not be any characters or empty lines before and after the php tags.

    https://codex.www.ads-software.com/Editing_Files

    Thread Starter cherylweb27

    (@cherylweb27)

    I just put it in a text file (notepad on Windows), then saved it as functions.php.

    I don’t think there are any characters or empty lines before the <?php and after the ?>

    I didn’t know there needed to be…?

    I will try putting them in, to see if that fixes the situation.

    Thread Starter cherylweb27

    (@cherylweb27)

    I added lines before & after everything in the functions.php file. No change. Thanks though @michael !! ??

    Thread Starter cherylweb27

    (@cherylweb27)

    I’m really a winner tonight… lol ??

    Michael, I re-read your post… like 5 times… and realized that you actually meant that there SHOULD NOT be any spaces or lines after the open & close php tags in functions.php.

    So I double-checked, and yes, there was one rouge space after the close php tag.

    So I removed it (along with the spaces I mistakenly added a few minutes ago), and VOILA! The errors are gone.

    Thanks soooooo much for your help!!!! ?? ?? ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Adding functions.php to child theme’ is closed to new replies.