The cross-eyed teacher one was a pun. Definition of a pun: "the humorous use of a word or phrase so as to emphasize or suggest its different meanings or applications, or the use of words that are alike or nearly alike in sound but different in meaning; a play on words."

Essentially a play on words, as it says.