Wordpress查询将日期作为自定义字段发布

I have multiple post types - 'news', 'events' and 'others'. I want to combine them in one query - sorted by the date of creation. At the moment the following query provides the result:

query_posts( array( 
   'post_type' => array('news', 'events', 'others'),
   'showposts' => 4,
   'order'     => 'DESC'
) ); 

The post type 'events' have a custom field which is called 'cf_date'. This field contains the date of the event. The posts of the post type 'events' should first appear 10 days before the start. How is it possible, that the events can be created flexible and will be displayed (added to the query) 10 days before the event?

Thank you for your help!

Create a template named archive-events.php, copying the existing archive.php in your theme. Inside the loop, insert your test for the date, using get_post_meta on the date field. Set the template on Page Attributes to the name you used for archive-events.php.