wordpress - 当我使用 WP Comment_query() 时,没有出现回复评论链接
问题描述
我正在尝试使用评论自定义字段获取评论,因为我使用了 WP_Comment_Query() 但在回复链接中没有显示该函数。这是我的代码:
<?php
$args = array(
'type' => 'comment',
'meta_key' => 'comment-type',
'meta_value' => 'Other',
);
// The comment query
$comments_query = new WP_Comment_Query;
$comments = $comments_query->query( $args );
// The comment loop
if ( !empty( $comments ) ) {
foreach ( $comments as $comment ) {
?>
<div class="comment-text"><?php comment_text(); ?></div>
<div class="reply">
<?php
// Display comment reply link
get_comment_reply_link( array_merge( $args, array(
'add_below' => $add_below,
'depth' => $depth,
'max_depth' => $args['max_depth']
) ) ); ?>
</div
<?php
}
} else {
echo 'No comments found.';
}
?>
解决方案
推荐阅读
- python - 如何为 Windows 创建(或扩展)Python 3.x 可嵌入 zip
- bash - csvfile 中每月的最后一天
- java - RedisSystemException:未知的redis异常;嵌套异常是 java.lang.NullPointerException
- java - 我的倒数计时器代码无法正常工作
- javascript - 无法在视图目录中查找视图“index.ejs”
- ios - Swift:如何将 [String:Any] 数组转换为特定数组
- python-3.x - ValueError:未知标签类型
- javascript - 我如何保持一组包含在 div 内联中的元素?
- mongodb - 创建 AMI 映像时 MongoDB 服务器实例关闭
- serialization - 如何在 JPEG 中序列化量化的 DCT 系数?