add_action( 'pre_get_posts', 'add_my_post_types_to_query' );
function add_my_post_types_to_query( $query ) {
// test to make sure this is the main query
// and not the admin
if (is_admin() || !$query->is_main_query()) {
return;
}
$query->set( 'post_type', array( 'post', 'event' ) );
return $query;
}