Add sorting to posts collection retrieval.