Home › Forums › Calendar Products › Filter Bar › Add Filter with existing taxonomy/category
- This topic has 1 reply, 2 voices, and was last updated 5 years, 8 months ago by Andrew Peters.
-
AuthorPosts
-
July 11, 2018 at 8:34 am #1572696Andrew PetersParticipant
Hey there! I just got filter bar. My knowledge of PHP is pretty limited, but I’m a decent Googler. 🙂
I am using CPT UI to add two custom taxonomies to a few existing post types. Those taxonomies are ‘campus’ to select which location the event is relevant to, and ‘department’ to select which department the event is relative to.
I see the article on how to build a custom filter from scratch, but I cannot seem to find anything on adding an existing taxonomy to the filter bar.
I found this article as well: https://theeventscalendar.com/support/forums/topic/generic-function-for-adding-custom-taxonomy-to-the-filter-bar/
Can you tell me if I add that block of code and then add
new Tribe__Events__Filterbar__Custom('Taxonomy Name','tax_slug');
`new Tribe__Events__Filterbar__Custom(‘Taxonomy Name’,’tax_slug’);’to my functions.php file if that will solve my problem? Or is there something else I need to do?
July 12, 2018 at 1:35 pm #1574073AndrasKeymasterHi Andrew, thanks for reaching out to us!
Personally I haven’t played with that snippet much, but according to the poster it should work.
Based on what I read there you need to add that block of code to your functions.php file.
Then at the end, before the ‘endif;’ add the ‘new Tribe__Events__Filterbar…’ line as many times as you need.
Do not forget to change ‘tax_slug’ to the slugs your taxonomies use.
And that should be it I believe.
Let me know how that plays out.
Cheers,
AndrasAugust 3, 2018 at 9:35 am #1589712Support DroidKeymasterHey 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 ‘Add Filter with existing taxonomy/category’ is closed to new replies.