I try to create a WordPress theme and I have several issues.
I tryed to user the comment_reply_link but didn’t work at all, and I deside to create manualy the link by adding the code following:
<?php
$permalink = get_permalink() . "?replytocom=" . get_comment_ID() . "#comments-form";
$onclick = "return addComment.moveForm('comment-" . get_comment_ID() . "', '" . get_comment_ID() . "', 'comments-form', '" . get_the_ID() . "')";
?>
<a href="<?php echo $permalink; ?>" onclick="<?php echo $onclick; ?>">
<?php _e('Reply', 'z'); ?>
</a>
Also I have enqueue the comment-reply and is loading properly.
My custom made reply link is working properly. The form is moved under my comment when I click the Reply link but after I submit my comment the reply is not placed under the replied comment, but at the end of the comments.
Note : In my comment form I have enter the following code:
<input type='hidden' name='comment_post_ID' value='<?php the_ID(); ?>' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
and by using the Chrome console, I have see that the field comment_parent value is updated to the replied comment ID
Ok, i really don’t know how can i help you with your particullar problem, but i can give you some guidance for my custom comment template that is working perfect!
I make my comments template using Ian Stewart tutorial from ThemeShaper http://themeshaper.com/2009/07/01/wordpress-theme-comments-template-tutorial/.
First, the comments.php file looks like that:
I changed the Log In section because i use the Nextend Connect Facebook and Google plugins.
The Functions in functions.php:
and this:
Also, i make some minor modifications to the core comment-template.php to add an image next to the ‘Reply’ link. comment-template.php:
And finally, the CSS!
If i get it right, your main problem is the Answer for a particular comment is not showing properly, so maybe you need to look at your CSS for the, in my case, .depth classes.
If you want to test my custom comments template you can visit http://dfine.me and comment anything in any post. My configuration in the WordPress preferences is to allow only 1 nested comment.
Hope this helps!
PS: Sorry for the mixed ‘English-Spanish’ statements…