Effect on Custody
Although it can vary somewhat by state, issues of infidelity are typically not supposed to have any influence on a court's custody decision unless they have a definite, negative effect on your relationship with your children. If your kids aren't even aware that you had an affair, it probably would not influence the judge. If your spouse wants to make it known that you committed adultery, however, and can prove that it affected your child, there's a chance it might affect your court-ordered custody arrangement.
Most states use the income shares model for calculating child support, and the number of overnights your children spend with you post-divorce can affect these calculations. Depending on the respective incomes of you and your spouse, it's sometimes possible that if you share physical custody of your children on a nearly 50-50 basis, no child support would be payable. If the judge rules against joint custody and gives physical custody to your spouse based on your infidelity, it could result in your children spending less nights with you, and this in turn could mean a higher child support obligation.