Back in the 1960s “who’s the daddy?” stories were a staple of romance. The hero would agonize for most of the book, looking at the baby/child to see if it had his eyes, or his mother’s nose, or his father’s talent for painting, trying to work out if the child was his or not.
The baby’s mother may have been trying to protect him from the consequences of the child’s arrival (typically a heroine), or out of spite denying the child was his (bad gal). Either way, the parentage of the child was a major plot point.
Some authors are still writing this kind of story today. I’m sorry, but it will no longer work. Any hero worthy of the title will manage to take a few strands of the child’s hair and get them DNA tested. All he has to do is pat the child’s head and “accidently” catch a few strands of hair among his fingers. Or offer to brush the child’s hair. Or even get a saliva swab while helping the kid clean their teeth. There’s a million ways he could do it and none of them are difficult. Most of them aren’t even illegal.
The only kind of “Who’s the daddy?” story I’ll believe these days is a protracted court case while they fight over custody or visiting rights.
All authors, whatever their genre, need to be aware of the advances made by science, and keep their plots relevant.