Changed function used to generate post_name