Shrek (the movie) is just like its main character in the way that it has many different layers; layers of humor that is. Usually it is seen as a childish movie because of all the visual humor but it has qualities that even complex adults could find humorous such as parody, one liners, and sarcasm.
Use of puns: Shakespeare was a master at word play. In fact his play on words is a distinguishing feature of his works. He uses puns and witty language in his comedies.
Satire: This form of writing uses humor, irony, or wit to expose and ridicule personal, social, or political failings, often in an effort to correct them. Writers use satire to poke fun at a person, a group of people, an attitude a social institution, even all of humanity. Though satiric writing is meant to evoke laughter, its main objective is to expose and eliminate human stupidity and wickedness, and it is always intensely moral in its purpose.
Comic hero: The main or central character in a comedy who displays a measure of comic sense can be termed a comic hero. He does not have to be the classical, flawless kind but needs to have enough personal appeal to relate to and gain the full approval of the audience.
Parody/Spoof: These films impersonate, ridicule, or scoff at serious situations and people. These films rely heavily on satire and can be used as a means of social or political commentary.
Sarcasm: Involves a composer (most commonly a speaker) saying something that is the opposite of what they really mean.
Irony: Is used to suggest the difference between appearance and reality, between expectation and fulfillment, the complexity of experience, to furnish indirectly an evaluation of the author's material, and at the same time to achieve compression.
Taken from Walton, C. (2016). different styles of humour in shrek. HubPages. <http://hubpages.com/entertainment/different-styles-of-humour-in-shrek> accessed 17 May 2016