Sadly my “reply” link for threaded comments is not working.
The current situation:
First i load the comments reply script (check if scripts content load: works) into the <head>
using two functions (the first wp_register_script()
at the init hook, the second wp_print_scripts()
at the wp_head hook):
Then i add the Reply link:
comment_reply_link(
array(
'reply_text' => __( 'Reply', OXO_TEXTDOMAIN )
,'depth' => isset( $args['args']['depth'] ) ? $args['args']['depth'] : (int) 3
,'max_depth' => isset( $args['args']['max_depth'] ) ? $args['args']['max_depth'] : (int) 5
)
,get_comment_ID()
,$post->ID
);
which produces this html-output (example)
<a onclick="return addComment.moveForm("comment-11", "11", "respond", "149")" href="/wordpress/?p=149&cpage=2&replytocom=11#respond" class="comment-reply-link">Reply</a>
I got everything according to any recommendation i read:
My comments are within a <div id="comments">
and the comments form above it within a <div id="respond">
.
I still get dropped to the #respond-anchor and the comment form above the comments (http://localhost/wordpress/?p=149&cpage=2&replytocom=11#respond
), instead of getting the comment form displayed below the comment i want to reply to.
What may i do wrong?
Google, tutorials, how-to and else were so far of no help. Everything seems to be according to the recommended standard…
Thanks a lot.
Don’t link the script file directly. Enqueue it instead, e.g. in
functions.php
:You can also do this, in the document head, prior to the
wp_head()
call:EDIT:
Hooking into
wp_head
, rather than e.g.wp_print_scripts
, is important. Thewp_print_scripts
does not work in the same way thatwp_print_styles
does, to output stylesheet links.So: if you’re using
wp_print_scripts
, change the hook towp_head
.EDIT 2:
Based on your pastebin-linked code, have you tried the following, to rule out potential issues?
wp_comment_list()
wp_comment_list()
call to beforecomment_form()
callcomment_form()
I don’t know that any of those will solve your problem, but they may help us track down its origin.