@JonSnow From your description: posts in categories A and B are also in category E but are not being counted towards E's total when you expect them to. That might be because of how posts are assigned to categories and how these assignments are being counted, especially considering the "E,X" and "E,Y" vs. "A,E" and "B,E" categorization in the admin panel.
So you would need:
- Posts categorized in both parent and subcategories are counted towards the parent's total.
- All categories, including subcategories, are considered, with no posts missed in the count.