Mentioned briefly above was an angled bit on top of the fence - this is really worth looking into.
It's often used to contain cats in gardens - very hard to climb over a fence that has the top half meter or so angled inwards about 45 degrees.
I know cats and toddlers are different kettles of fish entirely but the physics still stands