如何解决回复评论的链接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属性应该是链接,而不是评论ID href="#comment-8"
我做了一些更改,我禁用了Yoast SEO Premium插件,并重播了它的工作链接,但是当我激活它时,链接断开了
解决方法
Yoast的版本7默认情况下会删除replytocom变量。 您应该在您的functions.php文件中添加代码
add_filter( 'wpseo_remove_reply_to_com','__return_false' );
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。