Added post types, code is a bit ugly.