查詢意見,我用下面的代碼(簡化)顯示的最後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。
任何消耗?