• Resolved Reid Currier

    (@critiqal)


    This is in response to Sort posts by custom fields value using dropdown menu that is unresolved and closed. Since I had trouble with this as well, I figured I’d post my answer here.

    The line
    if ($_POST['select'] == 'prijs') { $order = "&order=ASC&orderby=meta_value_num"; }

    needs to be changed to
    if ($_POST['select'] == 'prijs') { $order = "&order=ASC&meta_key=yourmetakey&orderby=meta_value"; }

    if the custom field you want to sort by is named “yourmetakey”.

  • The topic ‘Sort posts by custom fields value using dropdown menu – answered’ is closed to new replies.