[resolved] Comment Form is not working (5 posts)

  1. neczy
    Posted 10 years ago #

    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.


  2. Kafkaesqui

    Posted 10 years ago #

    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?

  3. neczy
    Posted 10 years ago #

    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?

  4. Kafkaesqui

    Posted 10 years ago #

    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.

  5. neczy
    Posted 10 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.