return the correct post for the given permalink