Forums Forums Search & Filter Pro Order by 3 x fields

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #236913

    Hi guys,

    I hope you’re well and coping ok under these crazy times at the moment!!

    I just have a quick query, we have around 20 search and filter forms which are ordered by 2 x custom fields, so that’s great we can set that up via the settings, but sadly we now need to order by a third field, how can we best achieve that?

    Thanks ever so much,
    Tonya

    Trevor
    #236926

    You would need to return the form order settings to default and instead use this filter:

    https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments

    Adding an orderby argument to the query. This search may yield some snippets:

    https://support.searchandfilter.com/forums/search/orderby+sf_edit_query_args/

    Anonymous
    #236928

    Ahh thanks Trevor for your quick help as always, much appreciated, will take a look 🙂

    Anonymous
    #237067

    Hello again Trevor,

    Sorry just a quick query as our client has asked this, when we are ordering by the 2 x different custom search fields we have set, please can I check what is then default ordering within that, ie say we are ordering by:

    Urgent
    Priority

    Is it then by title within? So first all ‘urgent’ entries in alphabetical order by title, then all ‘priority’ entries in alphabetical order by title? Or is it some other field?

    And either way, is there any way to override that default order to order by date as a global setting?

    Thanks ever so much,
    Tonya

    Trevor
    #237088

    The default order used by WordPress (and thus our plugin) is by Post Date descending (newest first).

    There are plugins that can alter this, but using them is likely to break the sort order you set in our plugin, and possible break the search entirely.

    As I said before, the only way to do this is using the filter I referenced.

    Anonymous
    #237098

    Thanks Trevor, have fed this back, very helpful as always 🙂

Viewing 6 posts - 1 through 6 (of 6 total)