Add edit function to posts.