I have a custom field "Field type - Date" with "Input only the date".
In a view I would like to query filter using this field but only search by year (YYYY).
I have tried the Query Filter as "number that is in the following..." I have also tried date and string and I have tried in and like but I cannot find as solution that returns a result unless I input using a datepicker.
Will this be a frontend filter or is it a backend filter? Assuming that this will be a frontend filter then it won't be possible to do. This is because the date field is queried as a timestamp which contains all the relevant information of that date such as month, day, year and time.
It is not possible with the view filters to filter by the custom field using the year only.
Hi Shane, I worried that might be the case.
Presumably this would be possible with wpv_filter_query though? Or am I going to have to do full shortcode?
I need to get a list of all posts, get all years, display all years as links, when a year is clicked filter posts by that year.
with the filter query, as it uses the timestamp I cannot think of a way that you can pass it a url, or could I pass it IDs?
Thanks Shane,
The Solution I went for was to create a new taxonomy and use custom code to update the taxonomy when a date is selected.
From all I have ready, taxonomy searching should be a lot quicker than a custom field especially if I proceeded down the original path it would have been multiple chained custom field searches.