WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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?

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.