The expression to “go by Shanks’s pony” means to walk. It usually implies that there is no other method of transport available, as in “Oh no! I’ve missed the last bus… I’ll have to go by Shanks’s pony”. It is one of the multitude of English idioms which has its origin in times past and whose literal meaning would be difficult to explain today. We know the underlying meaning so it is similar to an in-joke or a code.
Delving into this particular idiom, there is a rather nice theory that it refers to Mr Alexander Shanks, who invented a pony-drawn lawnmower in 1842. The mower was so big that it had to be pulled by a pony, with one man walking in front to guide the pony and one at the back to control the machine.
Even if this is not the true origin of the expression, it is feasible that it might refer to a Mr Shanks who owned a pony but for whatever reason would walk alongside it rather than ride it!