• I have an instance where I need to order by a custom field value before ordering by distance(DESC).

    E.g. this is how posts should be ordered

    $args[‘orderby’] = [
    ‘meta_value’ => ‘DESC’,
    // then
    ‘geo’ => ‘DESC’
    ]

    However, they are always ordered by distance regardless, seemingly because of the ‘posts_orderby’ filter which is overwriting the query ‘orderby’.

    Also, the ‘geo’ param referenced in the docs does not seem to work?

    Appreciate anyone’s help on this.

Viewing 1 replies (of 1 total)
  • Plugin Author jhackett1

    (@jhackett1)

    Hello,

    You’re correct, this is undocumented behaviour that should be added to the docs, or better, fixed to respect multiple ordering.

    I don’t have much time to work on it at the moment but a pull request would be welcome!

Viewing 1 replies (of 1 total)
  • The topic ‘Supporting multi orderby’ is closed to new replies.