I have created front end fields:
from: [wpv-control-postmeta field="date-from" type="textfield" placeholder="dd-mm-yyyy" url_param="date-from"]<br />
to: [wpv-control-postmeta field="date-to" type="textfield" placeholder="dd-mm-yyyy" url_param="date-to"]<br />
and using the following in my themes functions.php file
//------- filter post by date range -----
add_filter('wpv_filter_query', function($args, $settings, $view_id){
if($view_id == 387){
if(isset($_GET['date-from'])){
$args['date_query']['after'] = $_GET['date-from'];
}
if(isset($_GET['date-to'])){
$args['date_query']['before'] = $_GET['date-to'];
}
}
return $args;
}, 999, 3);
//------- end filter post by date range -----
The date range is being passed to the url but on clicking submit, I get a 'No items found' result. Any help would be greatly appreciated.
Hello. Thank you for contacting the Toolset support.
As I understand - you want to display the view which offer you the filter to filter the custom field date which actually holds value of start date and end-date - correct? The date-from and date-to is setup as custom fileds or you want to filter the post for default published date?
Can you please share the problem URL where you added the view as well as access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Ok - can you please send me full screenshot of your edit view page and please make sure the Query Filter section should be visible on your edit view page.