I have been through the depths of despair and I emerge victorious. In the end, changing “return $menu” to “return $items” solved my problem. Hope this saves someone the three weeks it cost me 🙂
I have been trying to implement this solution for many, incredibly frustrating hours. I have studied this topic and its links for a few days now, hoping to solve the problem on my own.
I can successfully show a fixed ‘notification counter’ in the menu using the first snippet that was provided, great! However when I try to use the second snippet for positioning the counter, the code seems to have no effect. It’s very possible I’m missing something basic, as it seems that many others on this topic/forum have had success adding notifications to their header menus.