WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Blank page upon comment submit (but works in default theme) (3 posts)

  1. afeminist
    Member
    Posted 7 years ago #

    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?

  2. afeminist
    Member
    Posted 7 years ago #

    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; ?>" />

  3. thilak
    Member
    Posted 7 years ago #

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

    Take a look at tech-buzz.net

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags