Home › Forums › General Issues › meta_query orderby overwritten by publish date › Reply To: meta_query orderby overwritten by publish date
Hi vanderduke, how were you able to fix that? I am having the same issue.
I am trying to sort posts Ascending based on a Date and Time Picker custom field called: date_and_time_picker. The code I have is the following:
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
query_posts($query_string.’&category_name=events&meta_key=date_and_time_picker&meta_compare=>=&meta_value=’.strtotime(date(“Y-m-d”)).’&orderby_meta_key=date_and_time_picker&order=ASC&posts_per_page=12&paged=’ . $paged);
For some reason it is sorting using the post date instead. Do you know what could be wrong with this code?
This is the page: http://www.beckywasserman.com/current-events/
Thanks,
Andrea
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.