Added root parent function for custom post types