ANALYSIS/OPINION:

With few exceptions, diversity of opinion in Hollywood ranges from left all the way to the far left. Public dedication to diversity is an obsession for “progressives,” as liberals now call themselves, but the one form of diversity where it actually makes a difference is diversity of thought. But Hollywood can’t allow that.

Vanity Fair magazine, which imagines itself a leader of progressive thought, learned this the hard way last week when it strayed, ever so gently, outside the orthodoxy of the liberal bubble. Technology columnist Maya Kosoff offered a bit of advice in an online video to Hillary Clinton: “Take up a new hobby in the new year. Volunteer work, knitting, improv comedy — literally anything that will keep you from running again.”

Social media critics pounced. The remark was “sexist,” presumably because knitting is no longer woman’s work (which is news to millions of women). One male reader was so offended that he tweeted a photograph of the magazine as kindling in his fireplace.

Moving quickly from mildly clever tongue-in-cheek to craven tail-between-legs, the magazine apologized that its video was “an attempt at humor, and we regret that it missed the mark.”

Taylor Swift, the reigning pop-music princess, learned a similar lesson.

Miss Swift presumably has opinions on the issues of the day, but prefers to shut up and sing. She apparently thinks it’s impolitic or bad business to mount a soapbox, and learned that it might be equally bad business to keep her feet on the ground. The Washington Post reports that some fans criticize her “for not being critical enough.”

She posted an Instagram photograph of herself at a concert captioned “I couldn’t have had a better year, all thanks to you.” Indeed, her new album “Reputation,” sold a million copies in its first week of release in November and became the top-selling disc of the year. She wrote a song for another act that won the Country Music Association award for song of the year. Not a bad year for anyone, it seems to us.

But who was she to have such a year with Donald Trump still in the White House? “[Miss] Swift encountered backlash for glossing over current events during a grueling, divisive year in which it has been impossible to avoid politics in pop culture,” wrote The Post’s Emily Yahr. She could have followed the lead of Barbra Streisand, Bruce Springsteen, Cher, et al., to use her fame to bash the president.

She might have taken her cue from another pop star, Billy Joel. “I try to stay out of politics. I have a right to believe in my own political point of view, but I try not to get up on a soapbox and tell people how to think,” the Piano Man told Rolling Stone magazine last summer. “I’ve been to shows where people start haranguing the audience about what’s going on politically, and I’m thinking, ‘You know, this isn’t why I came here.’ We’re more like court jesters than court philosophers.” How refreshing. How modest. How unlike our times.