Adding funciton to get posts for a user.