Home › Forums › Calendar Products › Filter Bar › Order of additional fields in filter
- This topic has 4 replies, 2 voices, and was last updated 6 years, 8 months ago by Lauren Tresp.
-
AuthorPosts
-
July 14, 2017 at 5:29 pm #1321537Lauren TrespParticipant
I cannot figure out how our additional fields are being ordered in the filter bar. It is not alphabetical and it is not the order they are listed in the additional fields. Is there a way to control the order?
July 17, 2017 at 6:18 pm #1322407VictorKeymasterHello Lauren!
Thanks for reaching out to us!
Unfortunately, there is no direct way to adjust the order of custom fields in Filter Bar at the moment. It may very well be possible with some custom development, but I do not have a workaround that is supported by the plugin.
There is an open ticket for this in our User Voice here: https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/13251324-control-the-order-of-items-inside-a-drop-dow-box-i
I’d suggest you add your vote to it and if you’d like also leave a note about your use case. This way it can get into one of our future feature releases.
I’m sorry for the news, but I hope this at least helps answer your question about the possibility of changing the order of filters.
Let me know if you have any other questions and I’d be happy to help as much possible.
Best,
VictorJuly 18, 2017 at 5:46 pm #1322991VictorKeymasterHi Lauren!
Just wanted to follow up with this to let you know that I was digging around the code a little deeper and I found a way to actually order the additional fields in the filter bar.
You would have to place the following code snippet into your theme’s functions.php file to make that happen:
/* * The Events Calendar - Change filter values order */ add_filter( 'tribe_events_filter_values', 'tribe_re_order_filter_categories', 10, 2 ); function tribe_re_order_filter_categories ( $values , $slug ){ if ( $slug == '_ecp_custom_2' ) { sort($values); // a-z //rsort($values); // z-a } return $values; }
Please give that a try and let me know if it works for you.
Best,
VictorAugust 9, 2017 at 9:35 am #1332896Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Order of additional fields in filter’ is closed to new replies.