Forums › Forums › Search & Filter Pro › 'Event Date' as a search field
Tagged: event date field
- This topic has 3 replies, 2 voices, and was last updated 10 years, 2 months ago by Ross.
-
Anonymous(Private) September 21, 2014 at 9:16 pm #4907
Hi Ross!
I have a question about using event date as a search field with your plugin.
Basically, I am developing a site for a client where the main function is to search events by genre, location and event date. And to facilitate such a search function I am using your wonderful plugin.
So far I have achieved everything I wanted with your plugin, only one function left – being able to also search for an event date rather than post date. Regarding events, I am using a third party plugin to create events and so on. That events plugin is using custom post type for events.
Now, I am wondering is it possible to link your plugin to create an event date field so in the results it will actually display events by its performance date rather than post/published date which it currently does with ‘post date’ field. And the event date is specified when the event is created as a custom post type.That’s the last vital function to be achieved for having a great events search form.
Your help is really appreciated!
Thanks,
TimurRoss Moderator(Private) September 22, 2014 at 1:39 pm #4918Hey Timur!
Sure you can do this, but there are some restrictions…
The date must be saved as post meta data – which pretty standard for most plugins/themes that are saving additional data on posts.
Then in S&F you can choose the ‘post meta’ field, and then you must choose your ‘meta key’ where the date is stored.
The date must also be saved as either YYYYMMDD format, or a unix timestamp.
Does that make sense? If not I can give you some more guidance on finding your meta key.
Thanks
RossAnonymous(Private) September 23, 2014 at 5:51 pm #4972Hey Ross!
Thanks for your reply!
I actually found ‘post meta’ field, but there from the ‘meta key’ list I only found ‘event_year’ meta key which didn’t really work when I tested it as a field in a search form, it just didn’t return any results. It’s actually strange that there is ‘event_year’ meta key, but not an ‘event_date’. Also, I noticed there is an option to input a meta key manually, but I am not sure how it works, and I believe in order for it to work particular meta key has to exist already.
Another thing, how the date is actually saved as post meta data? Should it already be implemented inside the event plugin? Or is it possible to save it manually and therefore create meta key ‘event_date’ that way? I am just new to meta data and meta keys subject.
Thanks for your help, Ross!
Timur
Ross Moderator(Private) September 29, 2014 at 11:22 pm #5253Hey Timur
You’re right about the first part – really the key should exist already – so I’m guessing the plugin you are using is creating them in maybe a strange way – possibly using different fields for different parts of the date – which this plugin does not know how to search.
For the second part – yes again! The plugin must already be saving this somewhere but just not as a typical date format.
This plugin works well with dates stored as YYYYMMDD or dates stored as timestamps… if you use the ACF plugin, you can easily add a date field to your posts (http://www.advancedcustomfields.com/) but I’m guessing you lose the other features of your plugin :/
Hope that helps!
Thanks -
AuthorPosts