Warning: Cannot modify header information
-
Hi, i have different problem now. I don’t know what it causes, but everytime when i edit my posts and for example change the category and then click “Update” i got this message:
Warning: Cannot modify header information – headers already sent by (output started at /data/web/virtuals/22236/virtual/www/subdom/wp-test-2/wp-content/themes/wp-test-2/functions.php:1) in /data/web/virtuals/22236/virtual/www/subdom/wp-test-2/wp-includes/pluggable.php on line 876
When i go back to previos page the changes are ok, category have changed and it works fine. But i don’t want this message :-).
I’ve looked to pluggable.php on line 876, where is:
header("Location: $location", true, $status);
and i don’t see anything wrong in it.
Some other informations:
– I’m making my own template from scratch
– I don’t use any plug-in right now (except Akismet, Hello Dolly and Meta Slider – but i tried to deactivate it – nothing changes)
– I also look at my functions.php – i have no blank rows or spaces befor or after my <?php ?>
– It must be something in my custom teplate, becouse when i change template, it works fine
– I even try to empty my functions.php file and it still don’t work, even if i have nothing at line 1
– But it have to do something with functions.php, becouse when i delete it completly from my template directory, update button works fine without warning!This is what i have in my functions.php:
<?php // functions if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name' => 'sidebar 1', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>' )); register_sidebar(array( 'name' => 'sidebar 2', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>' )); register_sidebar(array( 'name' => 'sidebar-right', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>' ));}
But i think it is not important – just existence of functions.php causes it – even if i have empty functions.php file in template directory. When i get rid of it, everything works fine. But i need that file, of course ??
It is not criticall, becouse everything works fine, post is updated, but i have still this message.
Thanx for help and sorry for my bad english ??
- The topic ‘Warning: Cannot modify header information’ is closed to new replies.