For those conservatives harboring hostile attitudes toward “liberal Hollywood,” this suggestion might not sit well. But if they want to win national elections, they should consider studying the example of primetime television.

A recurring theme since November has involved shifting demographic patterns, and how Republicans can pivot to embrace younger and minority voters without alienating their older and whiter constituencies.

According to a study by GOP pollster Whit Ayres and the Hispanic Leadership Network, “Republicans have run out of persuadable white voters,” citing dire consequences if the party doesn’t expand its profile and widen its tent.

Don’t look now, but TV programmers — especially the major networks — have been walking that tightrope for years.

Despite Hollywood’s perceived leftward tilt, embracing diversity hasn’t always come naturally. Indeed, it was only a dozen years ago the English-language broadcast networks produced a fall lineup without a single minority lead, triggering a backlash from advocacy groups and greater media focus on efforts to include people of color.

Like some Republicans, Hollywood discovered inclusiveness (or outreach, which seems to be the popular political terminology) based on pragmatism and a desire to win. In this case, that meant from a financial perspective, recognizing the growth of the Latino community and shifting attitudes among the younger population they target.

What seems clear, based on reaction to the 2012 electoral results, was the TV industry identified these trends — or at least, adapted to it — faster than the GOP did. So while there were bumps along the way on issues like gay acceptance — with advertisers and Southern affiliates balking at “Ellen’s” coming out or expressing concerns about “Will and Grace” — TV now finds itself better positioned to face a future that’s more diverse and progressive regarding social issues.

The related aspect of this is the threat such an evolution — whether motivated by a change of heart, or mere necessity — might endanger relationships with what Fox News host Bill O’Reilly has called “traditional America.” And for the GOP, there’s a Hollywood lesson there as well.

While the comparison isn’t completely direct, there are parallels. And here’s the good news: TV has taken older viewers for granted for decades while focusing programming to reach young-adult demographics (albeit to please media buyers, not win elections). The 50-plus cohort nevertheless continues to represent their most reliable customers.

Sure, senior citizens grumbled when CBS dropped the “Jesse Stone” movies or NBC canceled “Harry’s Law” — programs that performed disproportionately well among older audiences, but didn’t attract enough of their kids and grandkids. After the griping, though, they pretty dutifully returned, even if not everything is forgiven or forgotten.

Admittedly, even with years of practice the networks still haven’t mastered this balancing act. Attempts at diversity have ebbed and flowed. At times minority characters feel less than organic, as if shoehorned into shows as an afterthought. Tinkering almost always reflects a demographic objective, like making Sherlock Holmes younger and more buff, while giving his pal Dr. Watson a gender and racial makeover in CBS’ “Elementary.”

Nowhere has the demo divide been more pronounced than latenight television, where the desire to reach young men hastened NBC’s baton passes involving Johnny Carson and later Jay Leno, only to see the latter return, which hasn’t stopped speculation regarding when he’ll move aside for the next younger heir.

Despite all that, latenight is overpopulated by the older audience that remains a primetime mainstay for broadcasters, whose headlong pursuit of youth hasn’t prevented their median ages from creeping upward to 50 or above.

Fortunately, the networks have discovered the age divide can be bridged. Unlike “Harry’s Law,” it’s possible to find programs that attract large audiences overall and yield respectable ratings within younger demos. It’s not easy — especially with so many options, allowing viewers to feast upon personal-programming buffets — but it is doable, without completely disenchanting the traditional crowd.

Of course, for the GOP there is one major distinction. When pollsters talk about losing the base, the fear is if a party goes too far seeking to expand its appeal, once-loyal voters will “stay home.”

Whereas when TV viewers stay home, programmers have them precisely where they want them.