By saeeddarabi
Hi everyone,
I keep getting this error: Warning: Cannot modify header information - headers already sent by (output started at /custom_functions.php:1) in /wp-includes/option.php on line 837
Warning: Cannot modify header information - headers already sent by (output started at /custom_functions.php:1) in /wp-includes/option.php on line 838
Now, I checked my custom-function file, especially line 1 and can’t find anything.
Here it is:
<?php
/* ######################### Begin Registering Custom Widgets ######################### */
// Register the After Single Post widget to display 3 related posts
genesis_register_sidebar( array(
'id' => 'after-single-post',
'name' => 'After Single Post',
'description' => 'Latest 3 posts after comments',
) );
// Register "Top Parallax" widget
genesis_register_sidebar( array(
'id' => 'top-parallax',
'name' => __( 'Top Parallax', 'mp' ),
'description' => __( 'Top Parallax Widget.', 'mp' ),
) );
// Register "About" widget
genesis_register_sidebar( array(
Note: Since my file is long, I just pasted the first few lines.
I would appreciate any help. Note: I can still access my backend and work. But the warning is displayed on top of every page I access.
Frond-end is fine.
This also caused the issue of not being able to login from site.com/wp-admin (which I used to be able to do). When I access this page, it gives me this warning on an otherwise totally white screen:
Warning: Cannot modify header information - headers already sent by (output started at /custom_functions.php:1) in /wp-includes/pluggable.php on line 1210
Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
A quick way to fix that would be to enable output_buffering in your php.ini file.
Note that you might have to restart your Apache service after the change.
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.