• I am attempting to organise upcoming events via a custom meta field.

    The custom data is in US date format:

    7/13/10
    7/26/10
    7/30/10
    8/6/10

    Etc, Problem is, wordpress is listing next years events first! so

    1/9/11

    gets ranked before the 10 items. Why is WP taking the highest value for the year, but the lowest value for the month and day??

    here is my wp_query code:
    WP_Query('cat=5,6&orderby=meta_value&meta_key=listdate&order=ASC&posts_per_page=-1');

Viewing 1 replies (of 1 total)
  • Thread Starter Ben Casey

    (@casben79)

    anyone have an answer for this? is it a bug or do I have to find another way to order by dates in custom fields?

Viewing 1 replies (of 1 total)
  • The topic ‘orderby custom date field not sorting properly’ is closed to new replies.