The best treatment of sore nipples is prevention. The best prevention is latching the baby on properly from the first day.
Sore nipples are usually due to one or both of two causes.
Either the baby is not positioned and latched properly, or the baby is not suckling properly, or both. Incidentally, babies learn to suck properly by getting milk from the breast when they are latched on well. The soreness caused by poor latching and ineffective suckle hurts most as you latch the baby on and usually improves as the baby nurses. The pain from the fungal infection goes on throughout the feed and may continue even after the feed is over. Women describe knifelike pain from the first two causes.