Support » Themes and Templates » comment-reply script not working on custom comment output

  • I’m using a callback function to output the comments on my site, but I’m having problems with the reply script. I always get a full page reload.

    I’m calling the script in the same place as all my other scripts like this:
    if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
    The script is loaded correctly.

    I’m listing my comments like this:

    $a_args = array(
    	'type' => 'comment',
    	'callback' => 'custom_comments',
    wp_list_comments( $a_args );

    Here’s the code that generates the reply link:

    $a_args = array(
    	'depth' => $depth,
    	'max_depth' => $args['max_depth'],
    	'before' => '<div class="reply">',
    	'after' => '</div>',
    $s_reply_link = comment_reply_link(array_merge( $args, $a_args ));
    echo $s_reply_link;

    Haven’t customized the comment form yet, I just call it like this:
    <?php comment_form(); ?>

    The script works when I call the wp_list_comments function without the callback. The output inside the ‘.reply’ div is the same in both cases.

    [ Please do not bump, that’s not permitted here. ]

Viewing 1 replies (of 1 total)
  • Hey guys.
    If anyone would check out the code ( here ) and help me with this, it would be greatly appreciated.
    Don’t worry about the content and the ugly contact form for anonymous users. I need to make the ‘reply to’ script work.

Viewing 1 replies (of 1 total)
  • The topic ‘comment-reply script not working on custom comment output’ is closed to new replies.