How does order=asc effect a wp_query (its acting pretty weird in a loop)

I have a wp_query for a custom post type: events. I have a seven day calendar that is showing featured events on a page. Here is the wp_query and supporting code:

https://gist.github.com/1030760

Read More

you can see the calendar at seattleite.com/calendar/

the thing works great with one exception. It should be showing a featured event on Sunday. If I change the order => ‘asc’ to order => ‘desc’ I see the event for sunday but then I lose the event for today.

If I simply remove the order => item then I see what I see if I set order => ‘desc’

any idea how order is affecting my loop?

Related posts

Leave a Reply

1 comment

  1. If anyone comes across this question. WordPress Codex says the following to 'orderby' => 'meta_value' and the order param:

    Note also that the sorting will be alphabetical which is fine for strings (i.e. words), but can be unexpected for numbers (e.g. 1, 3, 34, 4, 56, 6, etc, rather than 1, 3, 4, 6, 34, 56 as you might naturally expect).

    You are querying event dates, so the order of the results might be wrong because of this alphabetical sorting.