• hi every body. i m new in wordpress and have been trying to create a theme for wordpress. I have watched the video tutorial at nettuts and trying to follow it.

    now the problem is that,
    i have been trying to add the comment form in the single post and it is showing fine.

    but

    when i click submit, the page radirects to another url (“http://localhost/adarsha_samaj/wp-comments-post.php”) and it stops there with nothing in the screen.

    i m confused, when i re-watched the video tutorial it worked fine in that tutorial, and i have done same thing as it show, but the comment in tutorial works but not in mine,

    can anyone tell me what is the problem?

    i have pasted the code from comments.php below. this is the form part only. i have not included the comment part.

    <?php if (comments_open()):?>
        <!-- start comment form -->
        <div class="grid_15" >
            <h2 class="comment_form">Add your Comment</h2>
            <form action="<?php echo get_option('siteurl');?>/wp-comments-post.php" method="post" id="commentform" >
    
            <?php if($user_ID):?>
            <p>Logged in as <?php echo $user_identity;?> </p>
            <?php else:?>
            <p><input type="text" name="author" id="author" value="" /> </p>
            <p><input type="text" name="email" id="email" value="" /> </p>
            <p><input type="text" name="url" id="url" value="" /> </p>
    
            <?php endif;?>
            <textarea name="comment" id="comment" cols="10" rows="2" ></textarea>
            <p><input type="submit" name="submit" id="submit" value="Submit" /> </p>
            <input type="hidden" name="comment_post_ID" value="<?php echo $ID;?>" />
            <?php do_action('comment_form', $post->ID);?>
            </form>
    
        </div>
        <!-- end comment form -->
    <?php endif;?>

    my wordpress does not require user to sign in to comment in the post.

    please help me.

Viewing 1 replies (of 1 total)
  • Don’t know if you figured it out but try this.

    Replace this line:

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

    with this:

    <input type="hidden" name="comment_post_ID" value="<?php the_ID(); ?>" />

Viewing 1 replies (of 1 total)
  • The topic ‘problem with comment form’ is closed to new replies.