Support

Home Forums Event Espresso Premium Filter events by more than one category with the [EVENT_LIST] shortcode

Filter events by more than one category with the [EVENT_LIST] shortcode

Posted: December 18, 2012 at 4:08 am


Benjamin

December 18, 2012 at 4:08 am

Hi,

We needed to filter our events by more than one category when using the [EVENT_LIST] shortcode. This is specific to our project (eg, an event belongs to categories a et b, and another event belongs to categories b and c, and we want to display them on two different pages).

So I made a little modification which works that way, and share it here if someone else need to do so. Be aware that it is more like a hack as I modified code in some event espresso core files, meaning that future updates will have to be done with a diff/merge utility.

I wanted to interfere the least with the data in database so I used the field “category_id” (text, NULL) in the wp_events_detail table. In fact I noticed this field was always set to NULL when using the event espresso plugin so I thought it wasn’t used at all (for the moment ?).

Here are the modified files :

1°- uploads/espresso/templates/event_list.php

2°- event-espresso/includes/event-management/insert_event.php

3°- event-espresso/includes/event-management/update_event.php

Download the files


Dean

December 18, 2012 at 4:14 am

Hi Benjamin,

Thanks for that, hopefully others can use this to their benefit.

I will pass these onto the devs to look at as well for possible inclusion in future versions.


Benjamin

December 18, 2012 at 5:05 am

Thanks Dean.

I forgot : it’s used with a comma separated list of categories
[EVENT_LIST category_identifier=”category1, category2, category n”]

The support post ‘Filter events by more than one category with the [EVENT_LIST] shortcode’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso