This is somewhat of a continued problem from another question that I had asked. Here is the original post. pre_get_post filter returns results when there should not be
Since then I added an orderby clause....
if ($post_ids) {
$wp_query->set('post__in', $post_ids);
$wp_query->set('meta_key', '_start_date');
$wp_query->set('orderby','meta_value');
$wp_query->set('order', 'ASC');
}else{
$wp_query->set('post__in', array(0));
}
return $wp_query;
Problem is that I need to order by another meta_key's value. The meta_key is'_start_time'
.
The $post_ids are compiled from another (complex)query and then I needed to compile that even more based on other factors. What I ended up with was the post ids that I needed and now I just need to display them in the order that I need.
I have the order by _start_date
working, but if there are more than one post on that date then they are not ordering by the right time that I need. So I also need to order based off the '_start_time'
meta_key value, but can't seem to find a solution for this.
Thanks for any help you can provide.