Forums › Forums › Search & Filter Pro › Date Picker In “Release Date” Filter?
- This topic has 11 replies, 2 voices, and was last updated 5 years, 1 month ago by
Trevor.
-
Anonymous(Private) April 9, 2020 at 5:54 am #239495
How did you get the “Release Date” filter to use a calendar date picker? I assume this has something to do with how you created the Custom Taxonomy, and I’m using the same plugin to create those… but I cannot figure out how to get a date range for one of my filters like you have for “Release Date”.
Trevor(Private) April 9, 2020 at 10:27 am #239512The date has to be stored as a custom field (Post Meta), not as a taxonomy. By definition, taxonomies (and categories and tags) are textual data and stored as arrays, and thus cannot be manipulated as numbers (such as ranges).
Custom fields can be any manner of data types, and single or array data (I use ACF to define mine), and so, if set to the correct data type, can be manipulated. One such number data type is date (dates are stored as numbers).
Anonymous(Private) April 9, 2020 at 3:11 pm #239565Awesome, thanks for the quick response!! I got the ACF plugin and successfully created the custom field “Show Date”. I see it in my custom post type of “Show”, which is great! That was relatively easy, so thanks for the guidance!
Now what I can’t figure out… how do you add that custom field as a Filter within your plugin?
Trevor(Private) April 9, 2020 at 3:21 pm #239568In the Form UI, it is a Post Meta object. Unless you have added data in at least one post for this field, it will not appear in the list of key names. Also, when selecting the key name, make sure it does NOT start with an
_
underscore (they appear twice in the list, once with and once without).Anonymous(Private) April 9, 2020 at 3:28 pm #239572OK… I’m getting there. I see this custom field in the Post Meta, as you’ve suggested, but:
1. What is the condition supposed to be? I have “show_date | date | not equal to | BLANK”
2. I still don’t see an option to add this field in the “Available Fields” section. How do I actually add it to my Search Form?Screenshot: https://drive.google.com/open?id=1KpACrkreP8RIr8yMuyOdY0Tk9LIuB1Wa
Thanks in advance!
Anonymous(Private) April 10, 2020 at 6:48 pm #239732I actually figured out that I need to add the “Available Fields” as “post meta” instead of the other filters that use taxonomy… so I actually got the date picker to show up as a filter.
However, it’s still not showing search results when I choose a date. I have 3 “Show” examples created, utilizing 4/9/2020, 4/10/2020 and 4/11/2020 as values. These are not coming up as results, and I’m not sure what settings to change to make this work.
-
AuthorPosts