A mother breastfeeds her baby. (iStock/iStock)

A Maryland judge ordered a breast-feeding mom to add formula to her baby’s diet. And the judge is totally right.

I know, counterintuitive. But stay with me.

And hey, dads — are you hearing this? Because this one’s about you. Listen to what the courts are saying here.

The mom in this case, Amber Brown, 27, had planned on exclusively breast-feeding her
6-month-old son.

Good, hooray, all the breast-feeding advocates will sing hallelujah because it’s the right thing to do. Breast is best, they say.

“On a population basis, exclusive breast-feeding for the first six months of life is the recommended way of feeding infants,” according to the World Health Organization.

But that’s not where the story ends. There’s more to an infant’s life than food.

Because when Brown and the baby’s father, Cory Donta Lewis, split up, she said the baby couldn’t spend time with his dad because of breast milk.

She couldn’t pump enough milk — which is a pretty common thing for moms — to keep the baby fed during an overnight visit with his dad.

So they took it to court, making the infant’s diet a docket item.

You could say this is all pretty unsavory.

But two family magistrates who heard the case in Charles County — Monise A. Brown and Mistey L. Metzgar — sided with the dad, who wants the right to feed the baby with formula when he has visitation. The mom has filed for an exception, arguing that the baby’s pediatrician says he can’t tolerate formula. Of any kind? Really?

By siding with the dad, the magistrates are speaking some serious next-level truth.

First, they are heeding the second part of the World Health Organization’s recommendation on breast-feeding, the part that says those first six month of breast-feeding should be “followed by continued breast-feeding with appropriate complementary foods for up to two years or beyond.”

So we’re six months in now, and this happy baby is loaded up with the nutrients, antibodies and warm-fuzzies that breast-feeding provides. That’s not an argument at this point.

But by issuing this court order, the judges are also giving a huge nod to all the moms who can’t breast-feed.

These women face a constant stream of mom judgment and silent scorn from the breast brigade. Trust me, I’ve seen it.

I remember a mom friend I had met just weeks after we both gave birth more than a decade ago. She is an accomplished architect who slays in a male-dominated field, yet she confessed to me how her doctors, lactation consultants and the fellow moms in our baby class made her feel inadequate and like a failure every time she got out a baby bottle.

“They just think I don’t want what’s best for my child,” she said.

Nope. Her body and her baby didn’t agree with breast-feeding. And instead, she was nourishing him a different way. As soon as she said it, I saw it. With pursed lips and exchanged looks, they were treating her like she was giving the kid a gin-and-tonic every hour on the hour.

“You know, breast-feeding is optimal,” a yogi told my friend and colleague Emily Wax-Thibodeaux, as she poured instant formula into a milk bottle during a baby-mommy yoga class a few years ago. Emily got the looks too, and she wrote a story about it that went viral, explaining her breast cancer and how a double-mastectomy saved her life but made her evil in yogaland.

So thank you, magistrates Metzgar and Brown, for that small boost for moms who need to use formula.

But the even bigger gesture here is recognizing the importance of fathers. Because having a meaningful relationship with dad is more powerful than two extra days of boob juice.

No, I don’t know the details of Brown and Lewis’s blowout. Maybe that baby is just being used as a pawn between a warring couple trying to get back at each other.

Bristol Palin, daughter of former Alaska governor Sarah Palin, used her breast-feeding schedule in a court hearing last year to deflect her former fiance’s custody demands.

But somehow, I suspect one and even more likely two female judges would see right through that pretty fast in this Maryland case.

Let’s get real here. A man who wants to step up, to spend time with a baby when the infant is time-consuming, exhausting and difficult, should have that opportunity.

Doing anything less amounts to calling baby nurturing women’s work.

This isn’t about congratulating Mr. Mom and crowning him a hero for doing what every parent should be doing.

If that’s what we are demanding of dads, then give one the chance to do it.

And let others see it can be done.

Twitter: @petulad