[resolved] Comment form not appearing while replying already posted comments (6 posts)

  1. Priyanka Veeranna
    Posted 3 years ago #

    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:

    	 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>
    	 } ?>
    <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">
            <li class="older"><?php previous_comments_link('Older'); ?>
            <li class="newer"><?php next_comments_link('Newer'); ?>
        <?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">
          <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 ); ?>
      	  <p class="cancel"><?php cancel_comment_reply_link('Cancel Reply'); ?></p>
    <?php else : ?>
    <h3>comments are now closed</h3>
    <?php endif; ?>

    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.]

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    See the comments.php template file in the Twenty Eleven theme.

  3. Priyanka Veeranna
    Posted 3 years ago #

    ok...i tried with the twenty eleven theme...its working now. Although, i don't understand what was the problem with my code?? :-(

    I have an another problem though....the reply link for each comment is sitting right on top of the next comment. it looks as though the link is for the next comment. any thoughts on changing this?

    And thanks esmi :-)

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    That sounds like a CSS issue. Try using Firefox with the Firebug add-on for this kind of CSS work.

  5. Priyanka Veeranna
    Posted 3 years ago #

    ufff.....this firebug plugin saved my day :-). I had to make some CSS change to the classes created by wordpress. thanks so much esmi :-)

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    Glad I could help :-)

Topic Closed

This topic has been closed to new replies.

About this Topic