Support

Home Forums Event Espresso Premium EE4 Calendar category filter order

EE4 Calendar category filter order

Posted: October 21, 2014 at 3:25 pm


Michael

October 21, 2014 at 3:25 pm

Hi. What’s the recommended way of ordering and re-ordering old category buttons in the filter? Thanks


Tony

  • Support Staff

October 22, 2014 at 2:23 am

Hi Micheal,

I’m sorry but I’m not sure I understand, could you explain this a little further please?


Michael

October 22, 2014 at 7:19 am

Yeah, thanks–The Calendar addon has the category filter option that displays the event categories above the calendar. I’m not sure how it decides which order to display the categories from left to right.
If I rename the categories and slugs, each stays where it was and displays the new name–so this is one way to ‘reorder’ them (they’re actually in the same order thouogh). However, if I need to reorder them later, once events are in the system, I will be changing the events’ respective categories by doing this, so this is only an option now.
I’d like to be able to order them arbitrarily.


Josh

  • Support Staff

October 22, 2014 at 8:42 am

Hi Michael,

It turns out that they are ordered numerically by ID. You’ll see the ID on the left column when you view the list of event categories in the Events > Categories tab. The ID gets incremented with each new category. So they display in the order you add them.

Technically they could be re-ordered with assigning new IDs by editing their term_id value in the wp_terms database table directly. With a tool like PHPmyadmin. This would require taking care because other WordPress post types use the same table. If you try changing the IDs, please be sure to back up your database first.


Michael

October 22, 2014 at 9:53 am

That’s not exactly correct, because my categories are not displaying in that order. It might be true on a clean db, but I have deleted a re-created the same category slugs a couple of times. I guess that means it’s using a different field, and what you are seeing is a coincidence.

Possibly related, when an event is in multiple categories, and using custom css colors for categories, I’m not sure how it’s picking which category color to use. It’s not the lowest ID number, and it’s not alphabetical. There is a definite hierarchy though: if I apply all categories at once, it displays the category x color. If I apply 1 at a time, it will sometimes overrule, sometimes not, until I add category x, which will always win out over all others.


Josh

  • Support Staff

October 22, 2014 at 10:57 am

Hi Michael,

You are so right and I was so wrong. They are actually ordered by the term_taxonomy_id in the wp_term_taxonomy table.

Sine the custom CSS category feature doesn’t have a UI to set the category color to “win”. So if one event has multiple categories, it grabs one of the colors from the array of available categories.


Michael

October 22, 2014 at 11:01 am

Ah ok, this is very helpful–I just hope I won’t have to use it! thanks


Josh

  • Support Staff

October 22, 2014 at 11:14 am

You’re welcome.

The support post ‘EE4 Calendar category filter order’ 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