Comment form not appearing while replying already posted comments
-
Hey all, I am fairly new to wordpress…and i’ve been developing a theme for a client’s site(on localhost)..and i’m stuck on a problem and hope u guys can help me out.Here’s the problem:
In my single view posts page….the comments are listed under my post using wp_list_comments and beneath the comments is the comment form.
My problem is, when i press on the reply link for a particlar comment, the comment form does not appear beneath the current comment instead it stays in its original place.Except, the ‘cancel reply’ link appears.How do i solve this?
Here is my comments.php file:<?php if(!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die('Please do not load this page directly. thanks'); if(post_password_required() ) { ?> <p class="noComments">This post is password protected. Please enter the password to view the comments </p> <?php return; } ?> <div id="comments"> <h5><?php comments_number('No Comments','1 Comment', '% Comments'); ?></h5> <?php if(have_comments() ) : ?> <ol class="commentlist"> <?php wp_list_comments('avatar_size=32&type=all'); ?> <?php if($wp_query->max_num_pages > 1): ?> <div class="pagination"> <ul> <li class="older"><?php previous_comments_link('Older'); ?> <li class="newer"><?php next_comments_link('Newer'); ?> </ul> </div> <?php endif; ?> <?php endif; ?> <?php if(comments_open() ) : ?> <div id="response"> <h3 style="color:#09F;">leave a response</h3> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <fieldset> <label for="author">Name:</label> <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" /> <label for="email">E-mail:</label> <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" /> <label for="url">Website:</label> <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" /> <label for="comment">Message:</label> <textarea name="comment" id="comment" rows="10" cols="50" ></textarea> <input type="submit" class="commentsubmit" value="submit comment" /> <?php comment_id_fields(); ?> <?php do_action('comment_form', $post->ID ); ?> </fieldset> </form> <p class="cancel"><?php cancel_comment_reply_link('Cancel Reply'); ?></p> </div> <?php else : ?> <h3>comments are now closed</h3> <?php endif; ?> </div>
Plz help.
[Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
- The topic ‘Comment form not appearing while replying already posted comments’ is closed to new replies.