Hello!
I am generating a custom query string utilizing a custom post type and fields from Toolset. The code
$meta_query[] = array(
'key' => 'wpcf-start-date',
'value' => date('Ymd'),
'compare' => '>=',
'type' => 'DATE',
);
$query = array(
'post_type' => 'event-detail',
'meta_key' => 'wpcf-start-date',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => $meta_query,
'posts_per_page' => 3
);
var_dump( http_build_query( $query ) );
generates the following string
post_type=event-detail&meta_key=start-date&orderby=meta_value&order=ASC&meta_query%5B0%5D%5Bkey%5D=start-date&meta_query%5B0%5D%5Bvalue%5D=20211120&meta_query%5B0%5D%5Bcompare%5D=%3E%3D&meta_query%5B0%5D%5Btype%5D=DATE&posts_per_page=3
I am substituting the date “20211120” with {{dc:global:date format=“Ymd”}}
I have a similar string working on other sites but this one will not whereby a simple string such as
post_type=event-detail&orderby=meta_value&meta_key=wpcf-start-date&order=ASC&posts_per_page=3
works fine but does not yield the desired result. Any ideas on what I am doing wrong?
Thank you for any suggestions you can share!
Michael