Header already sent by post-template.php
-
After upgrading to 3.0 and trying to do a new post I get this error:
Warning: Cannot modify header information – headers already sent by (output started at /home/merlinsilk/domains/merlinsilk.com/public_html/wp-includes/post-template.php:54) in /home/merlinsilk/domains/merlinsilk.com/public_html/wp-includes/pluggable.php on line 890
I checked the usual suspects – spaces before or after <?php ?> but non of that. Checked if it was my older template, but it does the same thing with the new default template.
Then looking into the file where the error occurs I find
function the_title($before = ”, $after = ”, $echo = true) {
$title = get_the_title();
if ( strlen($title) == 0 )
return;
$title = $before . $title . $after;
if ( $echo )
echo $title;
else
return $title;
}and the error occurs on the echo $title. If I replace the echo with a return the error disappears, but I don’t want to leave it at that as this will probably cause problems elsewhere.
A brand new installation on the same server does not display that error.
Any idea – I am puzzled.
Cheers,
Merlin
- The topic ‘Header already sent by post-template.php’ is closed to new replies.