Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I know the problem may be too localized and specific to my theme only, but I think, if we can explore the problem, dig it, then we might find a new solution from it.

PROBLEM

I made a custom theme from Ian Stewart's theme lessons. Everything is ok, except the warning in the admin panel:

    Warning: Cannot modify header information - headers already sent by (output started at /home/nano/public_html/wp-content/themes/nanodesigns/functions.php:1) in /home/nano/public_html/wp-includes/option.php on line 568
    Warning: Cannot modify header information - headers already sent by (output started at /home/nano/public_html/wp-content/themes/nanodesigns/functions.php:1) in /home/nano/public_html/wp-includes/option.php on line 569

I've read most of THESE solutions, and even the Codex Solution and tried. At least I figured out that the problem is my theme specific and it's coming from the functions.php (not from wp-includes/option.php). Because the portion of the message in parenthesis is changing page by page, somewhere pluggable.php, somewhere else.php.

  • I checked and double checked the functions.php file and there is no space/spaces before or after php tags.
  • I deactivated/reactivated the plugins and there is no change.

THEN, WHAT THE HECK IS HAPPENED?

HERE is my whole bunch of code in functions.php. Just copied and pasted, no alteration made.

share|improve this question
Have you tried to remove the BOM? – toscho Jan 12 at 7:01
The pastebin link is broken. – s_ha_dum Jan 12 at 15:48
I deleted the Pastebin paste. – Mayeenul Islam Jan 14 at 7:00

closed as too localized by toscho Jan 12 at 19:11

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

At last SOLVED the problem with THIS STACKOVERFLOW ANSWER. Thanks to Gaurav Tyagi.

I added <?php ob_start(); ?> before the header redirection.

PROBLEM IS SOLVED AND CAN BE CLOSED. Thanks.

share|improve this answer
I would not consider that a fix. It sounds like you are just masking the problem. – s_ha_dum Jan 12 at 15:54
Your just putting duck tape around your problem. Turning on output buffering at top of every page is not a solution. – Chris_O Jan 12 at 18:10
Here is the Functions.php codes again. My problem is solved, may be by deceiving. But we can still dig the problem from the very core. I'll assist you with my best, inshALLAH. – Mayeenul Islam Jan 14 at 9:45
Yes, now I got the exact bug of my functions.php. I used different php blocks in some places. Like <?php code; ?> <?php separate code; ?>. Where functions file should be <?php code; separate code; ?>. When I made them in a single code snippet, the problem is solved. I just figured it out when developing another WP theme. – Mayeenul Islam Jan 14 at 19:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.