Home › Forums › Calendar Products › Filter Bar › Alphabetize Additional Fields in Filter
- This topic has 7 replies, 3 voices, and was last updated 6 years, 9 months ago by Cliff.
-
AuthorPosts
-
July 27, 2017 at 10:39 am #1327027JoelleParticipant
Hello, I’ve read the recent threads on this topic and tried this solution provided, but there is zero change.
/* * 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 == 'instructor' ) { sort($values); // a-z //rsort($values); // z-a } return $values; }
We are running WordPress 4.8, The Events Calendar Version 4.5.9, PRO Version 4.4.15 and Filter Bar Version 4.4.3. YES, I have deactivated all the plugs and themes and did that whole dance. 🙂
Any ideas?
========================
PLEASE LEAVE FOR SUPPORT
Reporting the same issue as:Â https://theeventscalendar.com/support/forums/topic/order-of-additional-fields-in-filter/July 28, 2017 at 9:44 am #1327533JoelleParticipantHiya! Checking in on this, as well. Thank you!
July 28, 2017 at 8:48 pm #1327792CliffMemberHi, Joelle. Sorry for the delayed reply here.
That code looks like it’s on the right track, but what is “instructor”?
Also, is sort() really what you want? If yes, you might want to try adding the SORT_NATURAL flag or do some other type of sorting just to check if your code is actually taking effect.
Please let me know what you find out.
July 31, 2017 at 11:07 am #1328414JoelleParticipant‘instructor’ is the slug for the drop-down that I want alphabetized. If that’s not correct, let me know.
But I tried it with your default code and that didn’t work either, so maybe I’m not doing it correctly.
This list (attached) needs to be alphabetized. We have done so in the backend, in the Additional Fields area, they are alphabetized in our list of options for that dropdown, but on the front end, it shows however it wants.
How can this be fixed?
July 31, 2017 at 11:08 am #1328416JoelleParticipantI forgot to attach the image, sorry.
July 31, 2017 at 11:14 am #1328424JoelleParticipantA HA! I figured it out. Oopsie, my bad. I needed to put _ecp_custom_4. I had the field slug wrong, so no wonder your default, nor my attempt worked. All is well on this one. Thank you!
July 31, 2017 at 7:27 pm #1328590CliffMemberGreat find! Thanks for letting us know.
FYI: Images don’t come through from email replies. Please keep this in mind for future threads.
-
AuthorPosts
- The topic ‘Alphabetize Additional Fields in Filter’ is closed to new replies.