Support » Fixing WordPress » Blank page upon comment submit (but works in default theme)

  • Resolved afeminist


    My site is running a custom theme which isn’t wildly different to the default. It has never had the registration facility active; due to the low (but increasing) number of visitors, I have decided to switch this on:

    – If the custom theme is used:

    a) non-logged-in users comment fine.
    b) when a user is logged in, upon clicking the “Submit” button, there is a blank page (wp-comments-post.php) and nothing is written to the DB.

    – If the default theme is used, no problems at all.

    This leads me to believe there’s something wrong with my custom theme comments.php file

    Having compared it line for line to the default template file, the only thing different or missing (excluding layout and presentation related code) is that my custom file was missing:

    <?php do_action('comment_form', $post->ID); ?>

    … towards the end, just before the </form> closing tag. Adding this doesn’t seem to have made any difference.

    Can anyone else give me some advice on where to look for issues to resolve this?

    Since the default theme is working fine, it MUST be my template… surely?

    Are there any functions or code that NEED to be be in the comments.php file related to users being logged in… ? Or something wider-reaching (such as code in another file for the template) that I’m unaware of, perhaps?

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is now resolved. Just in case others have this problem, the solution involved a missing hidden form field from the template:

    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />

    But on my blog, even non logged in users are unable to leave comments

    Take a look at

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blank page upon comment submit (but works in default theme)’ is closed to new replies.