Method to run code on custom post type display