查询意见,我用下面的代码(简化)显示的最后10条评论列表:WordPress的 - 通过邮局元
<?php
$args = array(
'post_type' => 'tarefa',
'number' => '10',
'order' => 'DESC',
'orderby' => 'comment_date',
//'meta_key' => 'field_name',
//'meta_value' => 'field_value',
);
$comments_query = new WP_Comment_Query;
$comments = $comments_query->query($args);
foreach ($comments as $comment) {
echo '<p>';
echo get_the_title($comment->comment_post_ID) . '<br>'; //post title
echo $comment->comment_content; // comment content
echo '</p>';
};
?>
问:
好,meta_key和meta_value似乎与comment_meta ......但在我的情况下,我必须显示评论根据post_meta键和val UE。
任何消耗?