You need to attract your wife back into the marriage. It sucks that she is the one doing wrong and you have to be the one trying to fix things but for now that is just the way it is. Just do the things you're advised to do and don't mention them to your wife right now. Trying to "explain" this stuff to your wife right now will just make her angry and resentful.
1. Read up on ENs (emotional needs). Identify your wife's top three and move heaven and earth to meet them several times each day. Remember that your WW (wayward wife) is telling herself every day how great OM (other man) is, how he understands her, how he is her soulmate. You have to shine, too!
2. Read up on LBs (love busters). Eliminate them completely. This is VERY important. Remember that EVERY time you raise your voice in anger, or slam a book down on the table, your WW says to herself "I can't live in a marriage like this" and she's closer to leaving. You absolutely MUST eliminate LBs.
3. Make a list of everyone that could exert any influence on the affair. This would include people like OM's wife, your wife's parents, your parents, your WW's best friends, your WW's siblings, your preacher if you're religious, etc. Then expose to everyone all at once. Tell them even if they already know; it's important that they hear this FROM YOU.
Do NOT tell your wife you're going to do this. Do NOT threaten to do it. Just nuke her world. The exposure message should go something like this: "WW is having an affair with OM. Although I'm devastated I'm determined to become a better husband and to do whatever it takes to save this marriage and make it the best it can be. Do you have any advice for me?" You should also confess your own affair when you expose, otherwise it will just look like you're pointing out her flaws while hiding your own.
If you tell your WW that you plan to expose, she will tell everyone close to her "My H and I are having troubles. He never listens to me, he doesn't understand me. He's always angry and he's paranoid. He accuses me of having affairs when all I'm doing is looking for support in how to fix our problems. I don't think we're going to make it; I can't get through to him, he's just crazy." Then when you expose guess what? You're the paranoid crazy husband accusing her of affairs when she's the angel looking for ways to fix the problems. So zip your mouth and don't mention exposure.
When you expose she will be FURIOUS. Expect it and don't let it ruffle you. She will tell you you've betrayed her and she can never trust you again. She will tell you she's filing for D. She will tell you she was going to give up OM and work on the M but you've ruined any chance you had. And on and on and on. Just remember that this is NORMAL following exposure and words are cheap. Unless she moves out, or unless you have D papers in your hand, it is ONLY talk. She will be furious because her "soulmate" relationship won't look so pretty in the light of day with all her friends and relatives looking at her and knowing. Following exposure, her anger and venom are GOOD things.
4. Spend 15 hours of quality time with your wife each week. This does not mean sitting in front of the TV together, or doing chores and watching the baby together. It means time focused on each other. Play cards after the baby is in bed, or run her a bubble bath with candles and a glass of wine. Sit on the porch and talk. Give her a foot massage. Do this EVERY DAY.