Getting warning on submitting the answer:
Also I am getting comments template many times.
Hello. I would like to say that I have this issue too. I am running multisite, but I have also tested this on a non multisite installation and it gives me the same error. It doesn’t matter what theme I use or if its with or without plugins, it does always tell me this error when I submit an answer (in this case I use twentytwelve):
Warning: Cannot modify header information – headers already sent by (output started at /home/xxx/public_html/wp-content/themes/xxx/header.php:14) in/home/xxx/public_html/wp-includes/pluggable.php on line 899
The answer is submitted and appears on the page though, but the error always is on the top of the page when doing so. The line of code it refers to in “pluggable.php” contains this:
header(“Location: $location”, true, $status);
When I remove that line it seems like it works and give no errors at all (which I actually expected to happen).
The line of code it refers to in header.php is actually anything that is in the header. If I put the header in HTML instead of PHP in header.php it does actually work and doesn’t show the error.
I did a lot of research on this, but I still can’t find what is going on. I have been following the tutorial on WordPress.org (http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F) without any results. I did like everything I could find on the web regarding this issue, like re-uploading the plugin in both ASCII and the other mode via FTP, changed my database encoding etc etc.
Normally I don’t like to bother the plugin writer for stuff you can find out on your own, but I’m kinda out of options right now :p At first I wanted to create a new question for this but it seems someone else has the same problem as me. Hurray!
If there is no fix I will try to hide the error with CSS or something, since it does work and submits the answers like it normally should. But if there is a fix that would be awesome!
As last thing I would like to thank you for this great plugin! I’m coming from the WPMUDEV (paid) Q&A plugin, but yours is like a gazillion times better! 🙂
Hi Ankush & Half Assed,
This warning message is commonly seen by websites using PHP. So there would be many reasons why this warning shows up. About WordPress, there are some tips for you to resolve it:
“I had to put a closing “?>” at the end of my functions.php and made sure there weren’t any spaces or line breaks.”
“1. Download your wp-config.php down via FTP (Edit directly if you have SSH access)
2. Open wp-config with your favourite editor, and remove all spaces before “<?php” and after “?>“
3. Upload and replace.“
“I found a simple solution that worked for me. Simply take the wp-config.php file, open it in a text editor and click save as. It will try to save as UTF-8 file, save it as ANSI. As i said this worked for me…“
“The issue turned out to be that the file was a UTF-8 encoded filewith BOM signature. This was causing the file header to be transferred prior the content has been processed, and therefore I have had the cannot modify headers error.
Please check your files encoding as well as if it seems to you there is no error in your script.“
Hope that helps!
Could you try to:
– Deactivate all plugins (exclude DW Q&A) to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
– Re-upload the “wp-admin” and “wp-includes” folders from a fresh download of WordPress.
– Switch to the default theme Twenty Twelve to see if the theme is causing the problem.
I would do the same to detect the issue on your sites. I can understand that you guys don’t feel comfortable providing us credential, but with admin account, I can have a better look at the issue. I can assure that your credentials will be safe with us.
I am also having this issue. It’s with a fresh install of WordPress using the standard-issue “TwentyTwelve” theme. I’ve tried it with other themes too, and the problem is always the same. Users can post questions with no problem whatsoever. The problem arises whenever somebody tries to answer the question. When someone answers a question, it creates the following error:
Warning: Cannot modify header information – headers already sent by (output started at /home/content/93/10068593/html/questions/wp-content/themes/twentytwelve/header.php:13) in /home/content/93/10068593/html/questions/wp-includes/pluggable.php on line 898
These are the same files mentioned by the other posters above … header.php and pluggable.php. It seems we are all having the same exact issue. It’s unfortunate, because I really want to use the plugin. It seems like a great resource for my visitors. But I can’t keep showing them an error message.
Has anyone had any luck figuring this out yet? Thanks!
Sorry for taking too long!
For those who are facing this problem, please go to Dashboard / Plugins / Editor, select DW Question & Answer plugin, then click to edit dw-question-answer/inc/actions.php.
Find this code below (at the very first of the file):
and change it into this:
Hope that helps!
Please login or Register to submit your answer