check wp-twinfield plugin
moved post type support where it makes sense. cleans whitespace a little.