I came across [this]) website that has a code snippet to automatically add children to top level pages called with wp\_nav\_menu(). It’s duplicating the children of the first top level page on the remaining top level pages. I’m expecting:
* Top Level Page 1
* Top Level Page 1 Sub 1
* Top Level Page 1 Sub 2
* Top Level Page 2
* Top Level Page **2** Sub 1
* Top Level Page **2** Sub 2
But what I’m getting is:
* Top Level Page 1
* Top Level Page 1 Sub 1
* Top Level Page 1 Sub 2
* Top Level Page 2
* Top Level Page **1** Sub 1
* Top Level Page **1** Sub 2
For the life of me, I can’t figure out why this is happening. The function is being called the correct number of times. The `$item` is correct each time. Yet somehow they all end up with the same children.
[ad_2]