hi,
i am trying to display a list of events for several categories.
i want to show on the screen the category in which the event belongs to.
something like this but with the template itself: %event_title% (%event_cats%)
but, the attribute for event_category allow only ONE category!
so, my question is this –
1. is there a way to display multiple categories in one list of events
2. how can i display the category name?
i have been trying to update this template:
shortcode-event-list.php
thanks!
Rachel Druskin
hi,
i just though of a solution 🙂
create a new event category that will be the parent of all the categories i want to show in the list.
now – i just need to figure out how to display the category name….
Rachel Druskin
Hi Rachel,
Do you mean the shortcode attribute (to get events in particular category/ies):
[eo_events event_category="foo"]
or the placeholder tag to display the event’s categories:
[eo_events] %event_title% - %event_cats% [/eo_events]
Stephen Harris
hi Stephen,
i mean the shortcode attribute
Rachel Druskin
Hi Rachel,
I think you should be able to list several categories at once, separated by a comma:
[eo_events event_category="foo,bar"]
Otherwise as you mentioned using parent categories could work.
Stephen Harris
hi Stephen,
you are right, i could use a comma 🙂
another thing – how can i display the category name using shortcode in the template?
Rachel Druskin
You can display and event’s categories using the %event_cats%
placeholder.
Stephen Harris
hi Stephen,
in the template? how is it done?
i want to display the categories right after this:
” title=”<?php the_title_attribute(); ?>” ><?php the_title(); ?> CATEGORIES_HERE
Rachel Druskin
Something like:
<?php echo get_the_term_list( get_the_ID(), 'event-category', '', ', ',''); ?>
would work. Event categories are just taxonomy terms, so you can use all the standard WordPress taxonomy API. (See codex).
Stephen Harris
Something like:
<?php echo get_the_term_list( get_the_ID(), 'event-category', '', ', ',''); ?>
would work. Event categories are just taxonomy terms, so you can use all the standard WordPress taxonomy API. (See codex).
Stephen Harris
hi Stephen,
thank you! it works!! 🙂
Rachel Druskin
Hi Stephen,
it looks like it’s not possible to use more than one category in the subscribe link-shortcode:
[eo_subscribe title="Subscribe with Google" type="google" category="foo,bar"] [/eo_subscribe]
returns an empty calendar link. Is there a way to add more than one category to a subscribe link?
Thanks!
Oliver Flueckiger
Hi Oliver,
You can’t. But if you use the URL .../events/event/?event_category=foo,bar&feed=eo-events
that may work.
Stephen Harris