我有一个 wp_query,如下所示:
$the_query = new WP_Query( array(
'post_type' => 'Session',
'meta_query' => array(
'relation' => 'AND',
'track_clause' => array(
'key' => 'track',
'compare' => 'EXISTS',
),
'start_date_clause' => array(
'key' => 'start_date_and_time',
'compare' => 'EXISTS',
'type' => 'DATETIME',
),
'zoom_clause' => array(
'key' => 'zoom_recording_link',
'value' => '',
'compare' => '!=',
),
),
'orderby' => array(
'start_date_clause' => 'ASC',
'track_clause' => 'ASC',
),
'posts_per_page' => '-1',
));
但是,我现在想将此查询与 Wp Bakery Visual Composer Post Grid 一起使用,这基本上要求我将上面的代码表示为 URL 中的查询字符串
为了尝试使其正常工作,我将以下内容作为 URL
post_type=session&post_status=publish&posts_per_page=-1&meta_query[relation]=and&meta_query[0]=track_clause&meta_query[0][key]=track&meta_query[0][compare]=EXISTS&meta_query[1]=start_date_clause&meta_query[1][key]=start_date_and_time&meta_query[1][compare]=EXISTS&meta_query[1][type]=DATETIME&meta_query[1]=zoom_clause&meta_query[2][key]=zoom_recording_link&meta_query[2][value]=''&meta_query[2][compare]=!=&orderby[0][start_date_clause]=ASC&orderby[1][track_clause]=ASC
但是,虽然订购有效,但它显示的所有帖子都不是我所期望的。我想我的网址有问题?有人可以提供一些指导吗?