Suggestion – category class
-
I’d like to suggest that a category class be added for events. That would allow CSS customization based on the category. I change the background colour of an event title based on the category, to help viewers distinguish between types of events.
It may not be the best of code, but here’s what I use (a patch to 1.4.1):
243c243,251 < $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event">', $atts, $post ); --- > $category_class = ""; > $category_list = get_the_terms($post, 'tribe_events_cat'); > $category_slug = $category_list[0]->slug; > if ($category_slug) { > $category_class = ' ' . $category_slug . '_event'; > } > > > $event_output .= apply_filters( 'ecs_event_start_tag', '<li class="ecs-event' . $category_class . '">', $atts, $post );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Suggestion – category class’ is closed to new replies.