Archived topic
Cannot modify header information / Can't log in to my WP site
7 replies · Started by Nick Morales on March 3, 2020
I've seen multiple / related errors like this in the forum but most are related to other files, not the wp-login.php file. I normally log in with the via sitename.com/wp-admin/
I CAN NOT log in to my site, so don't ask me to run in debug mode.
[02-Mar-2020 23:19:04 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/gowithes/public_html/wp-content/themes/generatepress-child/functions.php:8) in /home/gowithes/public_html/wp-includes/functions.php on line 1610
[03-Mar-2020 05:01:55 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/gowithes/public_html/wp-content/themes/generatepress-child/functions.php:8) in /home/gowithes/public_html/wp-includes/pluggable.php on line 1265
[03-Mar-2020 07:30:15 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/gowithes/public_html/wp-content/themes/generatepress-child/functions.php:8) in /home/gowithes/public_html/wp-login.php on line 496
The last thing I remember doing what updating the UpdraftPlus WordPress Backup Plugin as well as maybe one other plugin.
Please help, not sure what to do. I can log into my cpanel to do anything that way.
Hi there,
Looks like something you've added in your child theme is causing the issue.
I would say try access your child theme's function.php file and remove the problematic functions in there and see if that works.
If that doesn't work, then you can try contacting your host to see if they are able to restore the last backup file where everything is working.
This is all that is in the function.php file for the child theme.
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
function enqueue_child_theme_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
?>
<?php
add_filter('acf/settings/remove_wp_meta_box', '__return_false', 20);
?>
Those are not functions in the default child theme from this page:
https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme
By default this is the content in the function.php file of the child theme:
<?php
/**
* GeneratePress child theme functions and definitions.
*
* Add your custom PHP in this file.
* Only edit this file if you have direct access to it on your server (to fix errors if they happen).
*/
function generatepress_child_enqueue_scripts() {
if ( is_rtl() ) {
wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
}
}
add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );
But this has site has been working like this for well over a year and is the same child theme code I have on other sites (without generatepress). I have not made any changes to the child theme in a long time, nothing recent. So why did it just stop working out of the blue? I updated the GeneratePress theme back at the end of January.
While this might not be the child-theme code from GeneratePress it's valid code.
So I should download the GeneratePress child-theme and replace my function.php file?
Yup let's try that first.
Ok, that worked but not sure why.
I left this out of the updated function.php file. Need to figure out what that was for.
<?php
add_filter(‘acf/settings/remove_wp_meta_box’, ‘__return_false’, 20);
?>