comment_reply_link not working.
-
the example that shows is using the wp_list_comments()…
I tried using ` <?php comment_reply_link(array_merge( $args, array(‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?>
` but this throws and error because (I think) $args is defined somewhere in the wp_list_comments and I’m not using that.I’m having the same issue. Anyone make any progress on this?
read this page guys: http://codex.ww.wp.xz.cn/Template_Tags/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display
fixed it for me.This is how I did it. The whole thing:
In header.php just before calling wp_head:
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>In single.php where by default:
<?php comments_template(); ?>
Change to:
<?php comments_template('', true);?>In comments.php where:
<?php wp_list_comments(); ?>
Change to:
<?php wp_list_comments('type=comment&callback=my_custom_comments'); ?>In functions.php define your function for comments (“my_custom_comments” in this example). And inside the function:
<div class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div>You can see an example of the function going to the page linked by fwoan & esmi on the comments below.
With this, the Reply link worked for me, but for the whole threaded comments thing you need to place some other bits as well in comments.php. You can find more info on: .
Hope it helps someone 🙂
Well, the link for info:
http://ottopress.com/2008/wordpress-2-7-comments-enhancements/
The topic ‘comment_reply_link not working.’ is closed to new replies.
(@alexstudio)
16 years, 1 month ago
All my plugins are turned off. I have threaded discussion turned on, comment-reply.js is loaded, and I have comment_reply_link right under the comment_text method. But the reply button does not appear.
If I switch out my comments.php for the default theme’s comments.php the reply button shows up, but it is just using the wp_list_comments() and this does not work for me; I could like to style the comments differently then wordpress has them arranged by default.
Please someone help.
my comments.php:
[Code moderated as per the Forum Rules. Please use the pastebin]