Home › Forums › Pro Support › Retrieve WPshowposts by meta key value (a date) compared to DateTime(now) › Reply To: Retrieve WPshowposts by meta key value (a date) compared to DateTime(now)
September 25, 2020 at 1:57 pm
#20033
Keymaster
Hi there,
You may need to filter the query itself.
First, install the latest testing version here: https://wpshowposts.com/wp-show-posts-1-2-0/
Then you can do this:
add_filter( 'wpsp_query_args', function( $args, $settings ) {
if ( 123 === (int) $settings['list_id'] ) {
$args['meta_key'] = 'acnb_live_date';
$args['value'] = date( 'Y-m-d' ),
$args['compare'] = 'compare_date';
$args['type'] = 'date';
}
return $args;
}, 10, 2 );
You just need to change the 123
to the ID of your list, then you have full control over the query.