Home › Forums › Calendar Products › Events Calendar PRO › Category Colors filtering
- This topic has 6 replies, 2 voices, and was last updated 8 years, 7 months ago by
Greg Cole.
-
AuthorPosts
-
August 25, 2017 at 1:15 pm #1340477
Greg Cole
ParticipantWe are using the Events Calendar Pro and shortcodes to display separate calendars – using a parent category, we then see all child-category events on the calendar views as expected. Using Category Colors plug-in with this to filter the results does not work as it shows all categories. We ‘hide’ the parent categories, but still all child categories are displayed.
Is there a way to get the list of categories being used for the current view so we can try to filter the Category Colors (create a custom legend, etc.) using this information? If we were able to pull the category being used in the current view (the parent category ID/slug) we should be able to then pull a list of child-categories and output our own legend above the calendar.
Any assistance greatly appreciated.
August 25, 2017 at 1:29 pm #1340488Courtney
MemberHi Greg
https://wordpress.org/plugins/the-events-calendar-category-colors/ is a 3rd party plugin, so we can’t really do much for support on that. However, I’m wondering if you’ve tried a shortcode containing multiple categories as an option.
Ex:
[tribe_events view="list" categories="barbecue, chicken, lunch, summer"]
Would that be an alternative for you?
Thanks
Courtney 🙂August 25, 2017 at 1:57 pm #1340525Greg Cole
ParticipantThank you – using multiple categories affects the view as needed, but that does not affect the display of the categories in the Category Colors add-on. While I understand you do not provide support for third-party plug-ins, I was simply telling you why I was seeking the information in hopes you had encountered a similar issue.
What I need to know is if there is any utility/function to be able to pull the category/categories used in the shortcode for the current view?
If I use [tribe_events category=”test”], is there any way for me to programmatically determine that the current view/page is using “test” as the category filter?
August 25, 2017 at 2:01 pm #1340526Greg Cole
ParticipantHmmm… just tried a shortcode with multiple categories and it does not seem to work at all:
[tribe_events categories=”bible-6, lang-arts-6, math-6, science-6, soc-studies-6, spanish-6″] returns all events.
August 25, 2017 at 3:12 pm #1340544Greg Cole
ParticipantI made a work-around by using ACF Pro taxonomy fields. I set the field to be shown on my individual calendar pages, and then selected the event categories I wanted to filter for on that page. Then, in the custom legend.php file I added to my child theme I used in_array to filter the categories displayed based on those items I had designated for that specific page.
Not as clean as it could/should be, but t works.
Cheers!
August 26, 2017 at 6:20 am #1340656Courtney
MemberThanks for that update Greg. That is quite a workaround, but I’m thrilled you’ve got it working!
Thanks
Courtney 🙂 -
AuthorPosts
- The topic ‘Category Colors filtering’ is closed to new replies.
