Support » Plugins » Hacks » comment_reply_link() not working

  • Resolved Luke

    (@lukejanicke)


    I am calling comment_reply_link() in my custom callback function for wp_list_comment().

    It isn’t working… at all.

    <?php comment_reply_link( array( 'before' => '<li class="reply">', 'after' => '</li>' ) ); ?>

    At this stage, I’m not using comment-reply.js to move the comment form. I’m just slowing building up from scratch my theme (a learning exercise). I want to implement threaded comments and the first step is to make the reply link work.

    Is that JavaScript actually required for the reply link to work?
    Why is there no output from this function in my code?

Viewing 1 replies (of 1 total)
  • Thread Starter Luke

    (@lukejanicke)

    Thanks to fwoan’s comment here

    I copied the code here.

    Which means I added the following bits to my callback function:

    function my_list_comments( $comment, $args, $depth ) {
        $GLOBALS['comment'] = $comment;
        extract($args, EXTR_SKIP); ?>
        …
        <?php comment_reply_link( array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
        …
    <?php }

    Initially, there was nothing to tell me I needed those parts.

    It all works now!

Viewing 1 replies (of 1 total)
  • The topic ‘comment_reply_link() not working’ is closed to new replies.