To write a romantic knock-knock joke, one needs to think of a single word that could be used as the first word or set of syllables in a romantic sentence. The single word is the response to "who's there?" and the romantic sentence is the joke's punch line.
In most cases, the single word is not used literally in the punch line; Instead, it is used to sound like another word or words. A popular theme with knock-knock jokes is to use a name as the answer to the question, "Who's there?" That makes the knocking and answering scenario seem more realistic, and it creates an element of surprise for the listener.
For example, one could write a knock-knock joke as follows:
"Ida know why I love you so much."
In this joke, the name Ida, when paired with the word "know," becomes the similar sounding slang phrase, "I dunno."
However, not all knock-knock jokes use peoples' names or syllables. For instance, one could write a romantic knock-knock joke with a vegetable, like this:
"Peas be my Valentine."
In this joke, the noun "peas" becomes "please" in the punch line.