我有两个自定义帖子类型doctors
和location
. 每个doctors
职位与location
使用高级自定义字段关系字段发布。我想写我的WP_Query()
代码使用$wpdb
类和纯SQL。我该怎么做?
$args = array(
\'post_type\' => \'doctors\',
\'meta_query\' => array( array(
\'key\' => \'location\', // name of custom field
\'value\' => \'"\' . get_the_ID() . \'"\',
\'compare\' => \'LIKE\',
) ),
);
$testimonials = new WP_Query( $args );