Support » Fixing WordPress » comment_reply_link not moving my form?

  • Hi there,

    I’m having a problem with the moveForm function triggered when replying on an excisting comment. I just can’t seem to get it working, the respond div just won’t move under the comment I’m replying on.

    Everything seems to be in order:
    In my header I call the comment-reply javascript just before wp_head:

    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
            // enqueue the javascript that performs in-link comment reply fanciness
            wp_enqueue_script( 'comment-reply' );

    Which does get loaded correctly like this:

    <script type='text/javascript' src=''></script>

    To be sure the problem isn’t in my comments.php file I removed the callback function and put wp_list_comments(); before comment_form(); but that didn’t change anything…

    In the comment form the Reply link is added like this:

    <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

    The output of the Reply links seems to be correct:

    <a  class="comment-reply-link" href="/wordpress/feature/postname?replytocom=51#respond" onclick="return addComment.moveForm("div-comment-51", "51", "respond", "1878")">Reply</a>

    However the div- is missing in the comments list id’s, they’re supposed to be comment-51. So when I change my callback back to twentyten:

    wp_list_comments( array( 'callback' => 'twentyten_comment' ) );

    The output of the reply links become correct like this:

    <a  class="comment-reply-link" href="/wordpress/feature/postname?replytocom=51#respond" onclick="return addComment.moveForm("comment-51", "51", "respond", "1878")">Reply</a>

    But the form is still not moving, instead the reply-title in the allready excisting respond form changes and the cancel reply link show up…

    Tips anyone? Thanks for your help!
    Cheers, Toine

Viewing 2 replies - 1 through 2 (of 2 total)
  • Im having this exact same problem. Anyone know the answer????

    Adding the comment’s ID as a second argument to “(get_)comment_reply_link” fixed the issue in my case:
    $reply = get_comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])), $comment->comment_ID);

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘comment_reply_link not moving my form?’ is closed to new replies.