In the earlier days of the Church there was no law which forbade priest from marrying. Most were married before being ordained as priests and all were married before being elected as pope.
See the link below for a list of all married or sexually active popes.
Yes, there have been married popes, including St. Peter, the first pope.
There were 38 popes before Anastasius I.
A number of early popes were married before it was decided that the clergy should not be married. This is a decision of the Church and was not dictated by Our Lord.
Six popes are believed to have been married; including the first (St Peter), whose mother in law is mentioned in the Bible. All married popes were married before taking holy orders, the last married pope was Pope Honorius IV (1285-1287) who had at least 2 sons.
There have been two popes named John Paul and neither was married. Popes are priests and priest are not allowed to marry.
There were 264 popes before Benedict XVI.
There were 264 popes before Pope Benedict XVI.
There were 264 popes before Benedict XVI.
There were 257 popes before Pius X.
Pope John Paul II was the 264th pope so there were 263 popes before him.
He has never been married. Priests, including cardinals and popes.