Comment Reply javascript

I am working on a client site which is a very stripped down theme. It has no standard html markups as a result of which the reply box doesn’t move upto the place of being just below the comment to which you hit the reply button.
Can anyone point me to the minimum markup required? I am trying to add classes one by one.

Trying to explain it better:
I click on the reply button, the page reloads and the comment form stays below all the comments list. I want it to make it work like when we click on reply button, then without any page reload, it jumps up there and can be cancelled back to the place. The default what we have in Twentyten

Read More

Update:
I managed to fix up the markup and now I am using comment_form() but cancel reply button doesn’t appear and I am not filtering that out. Any ideas?

Done
So sorry to trouble everyone here. The last issue was fixed by removing the CSS display:none; ( Lesson – DIY Themes sucks unless its what you do! 😉 )

Related posts

Leave a Reply

4 comments

  1. You should really use comment_form() instead of rolling your own.

    Still, if you must, make sure that:

    1. The textarea has id=”comment”.
    2. The wrapping container around the entire comment form (probably a DIV) has id=”respond”.
    1. You will have to enqueue 'comment-reply' script.
    2. Make sure your comment list (single comment markup li tag) has id="comment-12". Replace 12 with the correct comment id. This li tag should also display the necessary comment classes.
    3. The li tag should have a children like <article id="div-comment-<?php echo esc_attr( comment_ID( ) ); ?>" class="comment-body">{{all of the comment elements go here}}</article>.
    4. The rest of the comment elements(author name, date, reply link etc) everything should be inside that article tag.