Home › Forums › Calendar Products › Filter Bar › Apply month filter
- This topic has 5 replies, 4 voices, and was last updated 9 years, 7 months ago by
Tommy.
-
AuthorPosts
-
August 17, 2016 at 12:10 pm #1152754
Tommy
ParticipantDear all,
I would like to know if it somehow could be possible to add a Month filter to the filter bar.
Best,
TommyAugust 17, 2016 at 11:12 pm #1152977Brook
ParticipantHowdy Tommy,
This is absolutely possible. The Filter Bar is highly extensible, and you can pretty much anything to it. However, there is no preexising filter that does this, you would have to write the PHP code that would power it.
If you are the sort of person who writes their own PHP modifications:
- You will want to create a new class that extends Tribe__Events__Filterbar__Filter and put all of your code inside of it. Then just instantiate it, and it will add itself to the Filter Bar options in WP Admin, so you can set it to show up there.
- Checkout /the-events-calendar-filterbar/src/Tribe/Filters/ For all the filters we currently have. In particular I think Day of Week will be a helpful template to base your work off of.
- Below is an example of an snippet that adds itself as I’ve outlined above. This one is a custom time of day filter, but it shows you how to properly instantiate the class after you’ve created it.
https://gist.github.com/elimn/bfcda80db4711aafbb36d708e25fb4b6
Does that all make sense? Will that work for you? Please let me know.
Cheers!
– Brook
August 18, 2016 at 9:27 am #1153150Tommy
ParticipantDear Brook,
Thank you so much for you reply.
I have no clue about writing my own PHP modifications:
But if I understand you correct I can use the one you added with a chance instead time stamp it has to be the different months ?
would this be something you could help me with?
Where do I put it when it´d done?
best,
TommyAugust 18, 2016 at 2:43 pm #1153383Brook
ParticipantHowdy Tommy,
Sorry if I was not clear, this will definitely require a goodly bit of custom PHP to do. I was just showing you how to add filters to the filterbar, what filters you add will be up to you or a programmer you hire. The example I showed you, especially the Day of the week filter, is getting pretty close to what you want but still quite a bit of different. It’s going to require a decent bit of custom code to turn that into a Month filter.
If you’re wanting to play the long game there is always the possibility that we would add this as a default filter in some future update. To get started on that track you would want to submit this idea to UserVoice. That route would definitely take a few months though, and it would likely need to garner support from some more folks. So your best route might be contacting a freelancer to build this for you.
Does that help clarify?
Cheers!
-Brook
September 9, 2016 at 9:35 am #1162098Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Apply month filter’ is closed to new replies.
