Posted: 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 |
|
Hi Micheal, I’m sorry but I’m not sure I understand, could you explain this a little further please? |
|
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. |
|
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. |
|
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. |
|
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. |
|
Ah ok, this is very helpful–I just hope I won’t have to use it! thanks |
|
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.