Add a funtion to create a new post and insert it into the database.