EDITED - I discovered that my problem only arises when the Yoast plugin is active. But I want to keep Yoast active, so my updated question is: Any idea what to do for comment replies working while Yoast is activated?
Here's my original question:
In a custom theme created by myself, or rather its child theme on a multisite, I am having trouble with the comment_reply_link
function. I am using it as follows:
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
Now on the website, the link doesn't result in the expected /?replytocom=6#respond
appended to the URL of the post, but simply in a local #comment-6
href
attribute for the link. So when a user clicks on "Reply", nothing happens. When he/she writes a reply then, it is posted as a first-level reply, not as a reply to the intended previous comment.
EDITED - I discovered that my problem only arises when the Yoast plugin is active. But I want to keep Yoast active, so my updated question is: Any idea what to do for comment replies working while Yoast is activated?
Here's my original question:
In a custom theme created by myself, or rather its child theme on a multisite, I am having trouble with the comment_reply_link
function. I am using it as follows:
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
Now on the website, the link doesn't result in the expected /?replytocom=6#respond
appended to the URL of the post, but simply in a local #comment-6
href
attribute for the link. So when a user clicks on "Reply", nothing happens. When he/she writes a reply then, it is posted as a first-level reply, not as a reply to the intended previous comment.
1 Answer
Reset to default 1Version 7 of WordPress SEO by Yoast removes the replytocom variables by default.
We’ve removed the option to turn off the replytocom variable. The replytocom feature in WordPress lets you reply to comments without activating JavaScript in your browser. However, every comment gets is own link and these could all end up in the search engines. So we now remove these variables by default.
To get the replytcom variables back we can add the following filter in our theme's functions.php
add_filter( 'wpseo_remove_reply_to_com', '__return_false' );