Function that creates a Wordpress custom post type