getLatest function returns latest post