回复 Link 评论在 wordpress comment_reply_link() 中损坏

Reply Link on Comments Broken in wordpress comment_reply_link()

我使用 comment_reply_link() 功能创建回复评论 link 但创建的 link 已损坏

我使用的脚本:

<?php
$argsComment = array(
   'reply_text' => '<img src="'. get_site_url() .'/wp-content/themes/webranko/img/SVG/reply.svg" alt="">',
    'depth' => 1,
    'max_depth' => 2,
);

comment_reply_link( $argsComment, $comment, $post->ID ); ?>

它创建了这个 link:

<a rel="nofollow" class="comment-reply-link reply replyToThisComment" href="#comment-8" data-commentid="8" data-postid="239" data-belowelement="comment-8" data-respondelement="respond" aria-label="replay to Admin" data-target="c_232">
    <img src="http://my-site.com/wp-content/themes/webranko/img/SVG/reply.svg" alt="">
</a>

href 属性应该是 link 而不是评论 ID href="#comment-8"

我做了一些更改,我禁用了 Yoast SEO Premium 插件并重播 link 它的工作但是当我激活它时它坏了 link

Yoast 版本 7 默认删除 replytocom 变量。 您应该在 functions.php 文件

中添加代码
add_filter( 'wpseo_remove_reply_to_com', '__return_false' );