• Resolved dogel

    (@dogel)


    Hi, I just discovered that as soon as I active Yoast on my website (self-developed theme + child theme in a multisite), the otherwise working comment_reply_link function doesn’t work anymore:

    Instead of the expected /?replytocom=6#respond appended to the URL of the post in the link, the link has a a simple #comment-6 in its href attribute.

    This is what my code for the comment reply link (in function.php) looks like:

    <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

    Since I can make it work by activating/deactivating Yoast, it seems obvious that the reason must be in Yoast. What can I do about it?

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

    (@dogel)

    I just got a working answer on wordpress.stackexchange.com:

    Version 7 of Yoast removes the replytocom variables by default. But it’s possible to add the following filter in the theme’s functions.php to get back the reply-to-comments functionality when using Yoast:

    add_filter( 'wpseo_remove_reply_to_com', '__return_false' );

Viewing 1 replies (of 1 total)
  • The topic ‘comment_reply_link function doesn’t work when Yoast is active’ is closed to new replies.