added new function to retrieve by slug and post type