Use post type support instead of an foreach.