Added support for custom post types and option to set title structure for custom post type