Support » How-To and Troubleshooting » [Resolved] Comment Form is not working

[Resolved] Comment Form is not working

  • Hey guys,

    I’m working on a new design and I’m just getting back into WordPress. I’m running version and here is my dilemma. I want to move the comment form into a right hand column, so I copied all of the necessary code into my sidebar.php and it looks okay, but when I go and try to send a comment in I just get a white page. The relevent link is here: http://www.neczy.com/wordpress. If anyone could help me out I’d be most appreciative.


Viewing 4 replies - 1 through 4 (of 4 total)
  • This shows up in the source when looking at the comment form in the sidebar:

    <input type="hidden" name="comment_post_ID" value="" />

    Note the empty value (which means you’re commenting to post # NULL). What does this portion of your “copied” code look like?

    Hm, yeah I didn’t notice that before. Here is the code I have in the sidebar.php concerning that… <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> It looks like it isn’t echoing the $id though, because of the lack of value being thrown in. Any ideas?

    Try changing it to:

    <?php echo $post->ID; ?>

    Assuming the $post array is still *available* when the comment form code is run off the sidebar, this should work.

    Sweet, I fixed it. After realizing that all that field was for was telling the comment form where to send it, I used <?php the_ID(); ?> to fill that value in, instead of <?php echo $id; ?>. That seemed to do the trick. Thanks for your help, without your observation I wouldn’t have ever thought of that solution!

    Thanks again, WordPress seems to get better and better each day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Comment Form is not working’ is closed to new replies.