parse_query() orderby date ignoring year
-
Hi,
I would like to do the following except I want to ignore the year. In other words, I want to order by month and then by day since it will eventually result in displaying a list to wish a happy birthday to people during a certain period.
$args = array( 'post_type' => array( 'player'), 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'ASC', );
I saw some possibilities with meta queries but I have no idea what to set as a meta_key and how to deal with that. I was also wondering if there was no easier possibility than using meta queries.
If I was not clear enough, here is the order I would like :
– Bob, 22/11/1960
– John, 30/11/1957
– Tim, 01/12/1959while my current code gives :
– John, 30/11/1957
– Tim, 01/12/1959
– Bob, 22/11/1960Thanks for your help !
- The topic ‘parse_query() orderby date ignoring year’ is closed to new replies.