Implement pagination for posts