• Resolved elschnet

    (@elschnet)


    The website I work for is a local monthly magazin for events, so I have many events per day. I want to show the events like in the magazin: grouped by daily and category. As I look in the wordpress tables I understand, that there is no field for categories in wp_em_events like the normal WordPress Taxonomies.

    This article EVENT AND LOCATION GROUPING AND ORDERINGsaid, that groupby and orderby can be use with any field from wp_em_events and wp_em_locations tables. So I decided to change the event_slug field of the any event. It is now category-term_id plus the event_name. This can be done by a plugin later that fires on save new or edit events.

    Example data:
    Event1 – Name: “Konzert”, Category-Name: “Bühne”, Category-Term-ID(Bühne): “219”, new event_slug: “219-konzert”, start_date: 21.02.2019 19:30

    Event2 – Name: “Theater”, Category-Name: “Kinder”, Category-Term-ID(Kinder): “220”, new event_slug: “220-theater”, start_date: 21.02.2019 20:30

    Event3 – Name: “Party”, Category-Name: “Bühne”, Category-Term-ID(Bühne): “219”, new event_slug: “219-party”, start_date: 21.02.2019 23:30

    On the event page I use this:
    [events_list_grouped mode=”daily” orderby=”event_slug”]#_EVENTNAME<br/>[/events_list_grouped]

    So I hope, I get this output order: Event1, Event3, Event2 – first the events from the category “Bühne”, then category “Kinder”.

    But I get this: Event1, Event2, Event3. It is still ordered by start_date.

    In another test I edit the fields group_id from table wp_em_events and save the category-term-id in there. No Buddypress needed, so the field is empty and useless for this page. But this failed too.

    Is it really true that orderby can be use with any field from wp_em_events? How can I handle this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Events Categories are WordPress Taxonomies and Events are Custom Post Types. You might want to check our shortcodes and try if the grouping shortcode attributes could help you.
    https://wp-events-plugin.com/documentation/shortcodes/

    You might want to check the [events_list_grouped] and the attribute groupby and scope

    Thread Starter elschnet

    (@elschnet)

    Hi Timrv,

    as you read, I tried it with [events_list_grouped], but there is no groupby categories, or?

    • This reply was modified 5 years, 2 months ago by elschnet.

    No, I don’t believe the grouping by categories is an option as those are stored in a very different way.

    You could try to use different shortcodes, each one displaying only that category. That will group them together as well, as it’s outputted per shortcode.

    [events_list_grouped mode=”monthly” category=”2″], where “2” is the Event Category ID.

    Thread Starter elschnet

    (@elschnet)

    I try this, thanks Patrick

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘order by category’ is closed to new replies.