displaying multiple categories in eo_events

WordPress Event Management, Calendars & Registration Forums General Question displaying multiple categories in eo_events

This topic contains 12 replies, has 3 voices, and was last updated by  Stephen Harris 7 years, 9 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #16745

    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
    #16746

    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
    #16756

    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
    #16761

    hi Stephen,
    i mean the shortcode attribute

    Rachel Druskin
    #16766

    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
    #16772

    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
    #16785

    You can display and event’s categories using the %event_cats% placeholder.

    Stephen Harris
    #16787

    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
    #16789

    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
    #16790

    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
    #16791

    hi Stephen,
    thank you! it works!! 🙂

    Rachel Druskin
    #27130

    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"] 0 [/eo_subscribe]
    returns an empty calendar link. Is there a way to add more than one category to a subscribe link?
    Thanks!

    Oliver Flueckiger
    #27132

    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
Viewing 13 posts - 1 through 13 (of 13 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.