Any code or shortcode for this idea.
In this example how to get the number “56”:
Examples of use (sidebar menu):
In the past, I solve this in some project by custom code (codepen below).
But It will only work if the full collection list and a counter-menu will be on the same page + complex.