I am using Wordpress as a CMS on a website which has standard posts, a custom advert post type and a custom event post type. The event post type has some custom meta which stores the event start date.
I am attempting to make a feed of all three post types on the home page (i.e. index.php). The standard posts and advert posts need to be ordered by their post date, but the events need to be ordered by their start date and slotted into the feed in the correct position.
Is it possible to run a query which selects all three post types and two of the post types by post date and one post type by a meta value? I'm currently using this query to bring in the standard posts and advert posts:
if (is_home() && $query->is_main_query()) $query->set( 'post_type', array('post', 'ecs_adverts'));