Home › Forums › General Issues › Order by date problem when same value › Reply To: Order by date problem when same value
If this is a bug it would be a WP bug. But looking at your query there are few things that stand out. One is that you have a meta_query that I don’t think you need and the second is that in that meta_query you are telling that the meta field is a date and I’m pretty sure that WP expects this to be in YYYY-MM-DD format, so your dates may be being read wrong. The last thing is that you are using orderby => meta_value_number.
Try this for your query:
$args = array(
'post_type' => 'project',
'meta_key' => 'project_date',
'orderby'=> 'meta_value',
'order' => 'DESC',
'paged' => $paged
);
$wp_query = new WP_Query($args);
get_template_part('templates/loop', 'project');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.