How can one limit the number of top-level categories returned by wp_list_categories, without limiting the display of their children? Assuming that one does not know the IDs of the categories, thus using the exclude or include parameters is not an option.
For instance say there are 8 top-level categories, each with 10 children, and perhaps grandchildren as well. I'd like to limit the number of top-level categories displayed to the first 4 (by the default sort order), and each would still display all their children and grandchildren, if any.
Can this be done out of the box, or perhaps via a plugin?