Maybe. It will depend on the STI you have and any medications you are taking to treat it.
It’s not generally recommended to breastfeed if you have HIV or sores on your breasts from syphilis or herpes.
If you have an STI, discuss nursing your baby with your doctor before delivery.