Incorrect date list order with query_posts
-
So I’m printing out all of the posts of the post type ‘agenda_item’. They are ordered on the value of a custom field called ‘agenda-datum’. This custom field contains a date formatted in the database like this ‘yyyymmdd’.
The posts are ordered correctly, accept for these ones:
20130929
20130825
20131103They should be ordered like this ofcourse:
20130825
20130929
20131103Strange right? Anyone got an idea why this is happening?
Here’s my code:
<?php query_posts( array ( 'post_type' => 'agenda_item', 'meta_key' => more_fields("agenda-datum"), 'orderby' => 'meta_value', 'order' => 'ASC' ) ); while ( have_posts() ) : the_post(); // This prints the custom field value of 'agenda-datum' more_fields("agenda-datum"); endwhile; wp_reset_query(); ?>
Thanks!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Incorrect date list order with query_posts’ is closed to new replies.