The minor sought a writ of habeas corpus contending that the juvenile court failed to terminate the parental rights of his conclusively presumed father, James, before ordering adoption as his permanent plan. James had asked for custody, and was involved in reunification services when a paternity test excluded him as the biological father. He was released from the reunification plan and counsel was relieved. James ended his relationship with the minor and the Department’s subsequent attempts to locate him were unsuccessful. At the section 366.26 hearing, the juvenile court terminated the parental rights of mother and John Doe, and referred the minor for adoption. The appellate court issued the writ directing the juvenile court to terminate James’s parental rights after proper notice and an opportunity to be heard. Although James was excluded as the biological father, he was still the presumed father at the time of the 366.26 hearing. The court must terminate the rights of both parents in order to free the child for adoption. The court’s declaration of John Doe as the minor’s father did not cure the error.