Support for custom post types.

Fixed lots of whitespace issue as well