I have 3 meta fields related to dates: year = 2012 release_date = 14 November 2012 release_date_db = 20121114 I need to show the posts from year 2012 sorted by release_date. I made this: query_posts('meta_key=year&meta_value=2012&order=ASC&posts_per_page=7'); Code (markup): How can I order posts by release_date or release_date_db? THX
Did you try using the orderby parameter? http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
It's not so simple. I get it. This hepled me http://stackoverflow.com/questions/8856553/wordpress-custom-field-date-display-post-with-custom-date-current-in-ascendin
Hahaha I did. This is more complicated then simple meta key and value I needed to compare and 2 arrays. , all work now. THX for reply.