A function for creating custom post types - used in functions.php