Move code to show the latest post to a seperate file