I have several categories. For example: CATEGORY A and CATEGORY B.
What I would like to achieve is to show the historical archive by year of posts for the category I'm visiting. And if I am in a single post, I would like to show the history for the category to which it belongs.
Can you help me?