Added function to get all posts