我想检索某个parent_id的所有交易(自定义帖子类型) 这是查询:
$loop = new WP_Query(['post_type' => 'deals', 'post_parent' => $post->ID, 'posts_per_page' => -1]
并将发布定义为全局$ post;但是,如果我在某个帖子页面上,它将向我显示所有交易,但是我只想查看具有parent_id = $ post-> ID的交易。交易(帖子类型)的创建如下:
$data = [
'post_parent' => $postParent, // This one is hardcoded 749, the custom post ID of the one i choose.
'post_type' => 'deals',
'post_title' => $dealData['dealName'],
'post_name' => $dealData['dealName'],
'post_status' => 'publish',
'comment_status' => 'closed',
'post_category' => $dealData['country_category_id'],
];
我做错什么了吗?