Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi! I did this recently myself. If you FTP into your site, and navigate to wp-content > plugins > query-wrangler > sorts and edit the file default_sorts.inc

    Here is an example based on my custom Date field:

    ` $sort_options[‘STR_TO_DATE’] = array(
    ‘title’ => ‘None’,
    ‘description’ => ‘None’,
    ‘STR_TO_DATE’ => ‘%m/%d/%Y’,
    ); `

    Hope this helps!

    I should mention that because I left title and description as None, it showed up as this in my Sort Options. Set the title to whatever you want that sort option to be named, and the description is, well, the description! When I first did this, I wasn’t sure if those would somehow impact my sort, so I left them blank. Since they didn’t, I just never got around to changing it! lol

    So, the sort_options inside [ ] should be the custom field, and needs to match on the fourth line, as per my example above. For the => since mine was a date field, I put in the way the date would be displayed.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    solosimar,

    I’ll add sorting by meta_value to the next release.

    Thread Starter solosimar

    (@solosimar)

    Hey Jonathan,
    That would be great, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to sort by custom field?’ is closed to new replies.