评论的回复链接在wordpress comment_Reply_Link()中断开



我使用comment_reply_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 ); ?>

它创建了这个链接:

<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属性应该是链接而不是注释idhref="#comment-8"

我做了一些更改,我禁用了Yoast SEO高级插件和重播链接,但当我激活它时,它破坏了链接

Yoast的第7版默认删除replytocom变量。您应该在functions.php文件中添加代码
add_filter( 'wpseo_remove_reply_to_com', '__return_false' );

最新更新