• Resolved da-snap

    (@da-snap)


    After updating my site to 4.2.3 I get an Error on redirects and the media section doesn’t load. So I can’t login or see a preview of a page.
    When an Error shows up it is:

    Warning: Cannot modify header information – headers already sent by (output started at /htdocs/wordpress/wp-content/themes/formation_child/functions.php:1) in /htdocs/wordpress/wp-includes/pluggable.php on line 1196

    I tried to delete every thing in the Child-Theme folder except a minimal version of functions.php and the style.css, but I still get the Error. I also try to deactivate all Plugins with no success. When I delete the funcitons.php, I have no problems, except that the style from the original theme wasn’t loaded. So the error depends on the functions.php.

    My current functions.php looks like:

    <?php
    function theme_enqueue_styles(){
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

    Its the same as in this Post: https://ww.wp.xz.cn/support/topic/child-theme-functionsphp-breaks-admin but there is no answer.

    I tried it with a closing PHP-tag an I search many times for Spaces. My encoding in the child-theme is UTF-8.

    Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • anonymized-13749270

    (@anonymized-13749270)

    According to the error report, your child theme directory is formation_child and not formation-child.. I think they work the same but, it should be a dash one, as per the codex.

    Also, try erasing multiple line breaks in PHP files, you could also use

    ob_start();
    // do the redirect
    ob_end_flush();

    To avoid such errors. Just saying!

    Thread Starter da-snap

    (@da-snap)

    renaming was the trick. It’s working again. I don’t know if this solved the problem or if there was an other error from the update which would be solved by a new template.
    So I have to reenter the template settings, but it’s working!
    So thank you very much!

    anonymized-13749270

    (@anonymized-13749270)

    No worries, the error just faded away as you have set up the child theme properly.

    Glad this has fixed you issue. You’re welcome, and have a nice day !!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Child Theme functions.php breaks redirect’ is closed to new replies.