How I have done custom queries in the past is use $wpdb->get_col()
and just returned an array of IDs of the posts. Then I pass that to a get_posts()
passing the IDs to the post__in
parameter. That way you can then use WP standard controls.
How I have done custom queries in the past is use $wpdb->get_col()
and just returned an array of IDs of the posts. Then I pass that to a get_posts()
passing the IDs to the post__in
parameter. That way you can then use WP standard controls.