Help Desk

Set filter order of additional fields

  • Posts: 10 Topics: 8
    | Permalink

    Hi there,

    Can you help? I’d like my Event Calendar PRO additional fields to show in the order they have been entered in the additional fields page, not in alphabetical order. I note that alphabetical order for these fields came in a a tweak in Filter Bar 4.5: https://theeventscalendar.com/release-filter-bar-4-5/

    Could you help me turn off alphabetical order or show me how I might choose the order for each filed?

    Regards,
    Chris.

    Posts: 1546
    | Permalink

    Hi Chris,

    Thanks so much for reaching out!

    I just tested it on my site and I am able to see additional fields appearing in the order that I have added them.  Is this not the case for you?  If not, would you mind sharing a screenshot of what you have entered on your backend and what appears on the front end?

    As a first step, let’s try to rule out if there is some type of conflict at play.
    This is usually because of:

    1.    A conflict with another plugin

    2.    A conflict with your WordPress theme

    3.    A template customization for the Events Calendar that requires updating

    When it comes to that type of issue, it is preferable to troubleshoot in a staging environment if you have one.

    A first quick test is to simply temporarily revert back to a default WordPress theme such as twenty-sixteen to see if the issue persists.

    The next step would be to go through our testing for conflicts procedure and let us know what you find out.

    Basically the goal here is to revert back to a bare WordPress installation to see if the problem persists. It also allows us to pinpoint what the cause of the issue is.

    But, before you do that, there are 2 things I would advise:

    1.    Make a backup of your database

    2.    Consider activating a “Maintenance Page” plugin if you are doing this on your live site (to minimize impact on your visitors)

    Also, here is our Additional Fields tutorial which can show you what additional fields is capable of:

    https://theeventscalendar.com/knowledgebase/pro-additional-fields/

    Let me know how that goes!

     

    Thanks,

    Jaime

    Posts: 10 Topics: 8
    | Permalink

    Hi Jamie,

    Thanks for getting back to me. I’m sorry, re-reading my original post it wasn’t very clear. It’s the filter bar ordering that is alphabetical. Please see attached screenshots. It would appear that alphabetical ordering was added as a feature / tweak in Filter Bar from v4.5: https://theeventscalendar.com/release-filter-bar-4-5/

    Is there a simple way We can turn off alphabetical ordering in the filter bar and revert back to ordering the way the data was entered?

    Regards,
    Chris.

    Posts: 1546
    | Permalink

    Hi Chris,

    Thank you for clarifying.  Unfortunately there isn’t an easy way to go about doing this.  One option would be to revert back to the previous version where items were not ordered alphabetically.

    Alternatively, if you are so inclined, you can try to look at our templates and views in our Themer’s Guide and see if you can figure out a customization there:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    And finally, if this functionality is a requirement for your intended project, I’d suggest that a third-party developer would be the best way to make this feature happen on a short timeline. 🙂 We maintain a list of developers who work with our plugins on our Knowledgebase here:

    https://theeventscalendar.com/knowledgebase/find-a-customizer/

    Let me know how it goes!

     

    Thanks,

    Jaime

    Posts: 10 Topics: 8
    | Permalink

    Hi Jamie,

    Turns out it was actually REALLY easy. I found this post from your colleague Victor: https://theeventscalendar.com/support/forums/topic/how-to-sort-the-filters-in-the-filter-bar-alphabetically/

    I added his code to functions.php and modified it only slightly, changing ‘sort’ for ‘ksort’ to sort by key. It seems to have worked.

    Here is the code:

    * 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_11’ ) {
    //sort($values); // a-z
    //rsort($values); // z-a
    ksort($values);
    }

    return $values;
    }

    Regards,
    Chris.

    Posts: 1546
    | Permalink

    Hi Chris,

    Glad you were able to figure it out and thanks for sharing, you are welcome back in our support forums any time!

    For now, I am going to close this thread.

    Have a great week!

    | Permalink

The topic ‘Set filter order of additional fields’ is closed to new replies.