function to get all categories used by a user, with their respective post count