I would like to get the results from two custom message types and sort them by custom meta (event trigger date).
This code:
$warsztaty_q = new WP_Query(array( 'post_type' => array('kalendarium', 'warsztaty'), 'order_by' => 'meta_value', 'meta_key' => 'data_start', 'order' => 'ASC' ));
It would be nice, but first sorted "kalendarium", and then "warsztaty", so in the query results, messages from "kalendarium" are first sorted, and then "warsztaty" is not together.
I found this solution: https://wordpress.stackexchange.com/questions/71576/combining-queries-with-different-arguments-per-post-type
But I can not get the usual meta :(
Can anyone help me? :)
source share