Dieses Problem kennen sicher so einige, und auch ich litt schon seit einer ganzen Weile darunter, daß ich selbst als eingeloggter Admin auf meinem eigenen Blog keine Kommentare hinterlassen konnte (bzw. nur vom Backend, nicht aber von der Seite aus). Heute habe ich mir endlich einmal die „Zeit“ genommen, dem Problem auf den Grund zu gehen. Ich schreibe das deshalb in Anführungszeichen, weil es letztendlich keine drei Minuten gedauert hat, den Fehler zu finden. Hätte ich mich doch nur schon viel früher auf die Suche gemacht. ;)
[:en]This issue is certainly known to a few, and I too have had the problem for a while that I couldn’t leave any comments on my own blog when logged in as admin (I could comment only from the back end, but not from the website). Today I have finally taken the „time“ to go to the root of the problem. I am writing this in quotes, because in the end it didn’t take me three minutes to find the error. If only I had started searching much earlier. ;)
[:][:de]Das Problem bestand darin, daß im Kommentar-Formular ein versteckter Input fehlte, der bei WordPress aber immer vorhanden sein muß:
Wenn man also nach dem Abschicken eines Kommentars andauernd eine weiße Seite bekommt, sollte man mal nachsehen, ob man in seinem Kommentar-Template (normalerweise ist das die Datei comments.php
im Verzeichnis des betreffenden Themes) diese Zeile evtl. vergessen oder an einer falschen Stelle eingefügt hat.
In meinem Fall war es z. B. so, daß ich die Zeile an einer falschen Stelle innerhalb einer if-Abfrage eingefügt hatte:
Du bist eingeloggt als ...
[Formularfelder für Name, E-Mail usw.]
Dadurch war die Zeile also für nicht eingeloggte Besucher (Gäste) vorhanden, sodaß sie problemlos kommentieren konnten. War man aber eingeloggt (was ich selbst als Admin natürlich immer war), dann fehlte die Zeile, und wenn die fehlt, dann bricht WordPress sein Kommentar-Script eben kommentarlos (haha!) mit einer weißen Seite ab.
Richtig muß es natürlich so lauten:
Du bist eingeloggt als ...
[Formularfelder für Name, E-Mail usw.]
So wird die Zeile in allen Fällen ausgegeben, und dann klappt es auch als Admin!
[:en]The problem was a missing hidden input in the comment form, which is required by WordPress:
So if you constantly get a blank page after submitting a comment, you should check your comments template (usually that’s the file comments.php
in the directory of your theme) to see if this line has been forgotten or inserted at a wrong place.
In my case, for example, I had inserted the line in the wrong place inside an if statement:
You are logged in as ...
[Form fields for name, email etc.]
Thus the line was present for not logged-in visitors (guests), so they could comment without any problems. However, if you were logged in (which I, as the admin, of course always was), the line was missing, and if it’s missing, WordPress exits its comment script with a blank page without comment (haha!).
Correctly, it has to be like this of course:
You are logged in as ...
[Form fields for name, email etc.]
This way, the line is displayed in all cases, and then it also works as an admin!
[:]
Eine Antwort zu “[:de]Leere Seite nach dem Kommentieren eines WordPress-Posts[:en]Blank page after commenting on a WordPress post[:]”
Thanks for this post! :)