Donald Trump’s war on the “dishonest and corrupt” media reached new heights on Sunday in a series of tweets.

If the disgusting and corrupt media covered me honestly and didn't put false meaning into the words I say, I would be beating Hillary by 20% — Donald J. Trump (@realDonaldTrump) August 14, 2016

It is not "freedom of the press" when newspapers and others are allowed to say and write whatever they want even if it is completely false! — Donald J. Trump (@realDonaldTrump) August 14, 2016

The fact that Trump blames the media for his campaign’s flagging poll numbers may come as a bit of a surprise to people who’d been treated to months of takes about how the media was “fueling” Trump’s rise with $2 billion in free media coverage.

Is the press relentlessly biased against Trump, as Trump now says, or were political scientists like John Sides and David Hopkins right to see the press’s habit of lavishing attention on Trump as a key asset in his unexpected political success?

The truth is that while there has been a change in media outlets challenging Trump as they report on what he says — especially on MSNBC’s Morning Joe program and to, an extent, on CNN — the bigger thing that’s changed is the context.

Winning a presidential primary nomination and winning a presidential general election are simply very different things. Trump is a longstanding proponent of the “no such thing as bad publicity” school of thought, and he’s freakishly good at executing on a strategy of attracting attention at any price. But while this theory may apply to luxury condominium development, reality television, and presidential primaries, it most certainly does not apply to presidential general elections.

Trump’s theory of “any publicity is good publicity” worked well in the primaries

Donald Trump has long been a believer in shoring up media attention even if it isn’t favorable.

Going back to when the Trump Tower in Manhattan was built on the site of the former midtown flagship location of the Bonwit Teller department store chain, Trump faced media scrutiny. The old Bonwit Teller building featured art deco bas relief sculptures of semi-nude goddesses that were widely seen as offering considerable artistic value. As an alternative to preserving the existing structure, Trump committed to saving the sculptures during the demolition process and donating them to the Metropolitan Museum of Art.

Instead, for reasons that remain somewhat unclear to this day, they ended up getting destroyed, which earned Trump scoldings from the New York Times and others.

According to his first book, The Art of the Deal, articles about this controversy ended up serving as free publicity for the new building, helping it stand out from other Midtown properties. “From a bottom-line business perspective,” Trump wrote, “bad publicity is sometimes better than no publicity at all.”

A presidential primary campaign is one of those times. Modern primaries are odd affairs, featuring voter turnout that is both generally low and highly variable. People are asked to choose among sometimes bafflingly large fields of largely undifferentiated candidates. Among the 16 contenders for the GOP nomination, for example, every single one favored large tax cuts, less environmental regulation, no new regulation of firearm ownership, strict restrictions on abortion rights, and the repeal of Obamacare.

In these circumstances, almost anything you can do to stand out from the pack and get people to pay attention to you helps. And Trump was really, really good at setting himself apart.

He tweeted constantly. He made himself widely available to the media in unscripted settings. He said and did wild things. He was great for ratings, so people wanted to cover him. And obtaining constant coverage helped him find and bond with a base of core supporters, who got enthusiastic about him, turned out to vote in unexpectedly high numbers, and ultimately built up too much momentum to be stopped.

Trump’s media coverage was never especially favorable

Even back when constant media attention was helping Trump win the primary, it was making him unpopular with the public at large. By continuing to apply the same precepts, Trump simply continues to be unpopular. And by focusing attention on himself, he prevents his campaign from executing on the one strategy that could put an unpopular candidate over the top — getting people to pay more attention to their feelings about his opponent.

Throughout this process, many media professionals pushed back on the narrative that the press was helping Trump for one simple reason: He was consistently unpopular. The press wasn’t going soft on Trump; it was simply reporting, accurately, that he kept saying and doing outlandish things. People paid attention and decided that these outlandish things were bad and didn’t like the guy. The system was working.

Even as Trump rode the attention wave to the nomination, it should have been apparent to him that he had a serious problem. His own theory, after all, was that “bad publicity is sometimes better than no publicity at all.”

A general election for president of the United States is not one of those times. It’s essentially a binary choice between one of two major party nominees, so breadth of appeal matters a lot more than finding a niche audience. And presidential elections are always major news events, featured heavily on every television news broadcast and every online and print news outlet. Attention per se is not a valuable commodity in a context where even objectively uninteresting people like Bob Dole and Al Gore manage to garner massive attention.

Even worse for Trump is that he now faces a likely downward spiral: The worse he fares in the polls and the more he lashes out at the press, the worse his coverage is likely to get.

Gaining attention is counterproductive for Trump

While Trump’s unpopularity has been consistent and fairly massive, the polls in his head-to-head matchup with Hillary Clinton have bounced around quite a bit. The key to this, of course, is that there are two candidates in the race.

And while no major party nominee has ever been viewed as unfavorably as Trump, the No. 2 person on the list is Clinton herself. To win, Trump doesn’t necessarily need to convince people that they like him. He just needs to convince people that they like him more than they like Clinton. Back in mid-July when he’d narrowed or even closed the polling gap with Clinton, that’s how he pulled it off.

Many Bernie Sanders supporters had developed a negative view of Clinton over the course of the primaries, FBI Director James Comey called her email server use “reckless,” and there’ve been a steady drip of stories for a decade now about possible conflicts of interest related to Clinton Foundation fundraising.

Trump’s nominating convention was, in many ways, a mess. But by forcing both Trumpkins and conventional Republican Party elected officials to settle on a least-common-denominator message of “Hillary Clinton is bad,” it at least pointed the way toward a potentially winning strategy: Force a referendum on Clinton, who is not very popular.

But Khizr Khan’s star turn at the Democratic National Convention and Trump’s bizarre counterattack marked a reversion to the old strategy of obtaining attention at any cost. It’s not working because it’s actually never been an effective means of beating Clinton.

Trump now faces a downward spiral

The bad news for Trump is that he is likely facing a downward spiral of press coverage. Back when he was beating all comers in the GOP primary, one genre of positive press coverage he garnered was fulsome praise from horse race journalists about his political genius. Here, for example, are Joe Scarborough and Mark Halperin praising Trump’s allegedly formidable skills as a political communicator back in May.

In reality, of course, Trump was always communicating a message that most people found repugnant. But as long as it was helping him win primaries, a certain amount of television coverage was dedicating to praising him as a genius. Now that he’s losing to Clinton rather badly, that aspect of coverage will turn on him — focusing on the tactical indiscipline of his campaign and its lack of organizational structure or proper strategy. What’s more, the worse Trump fares in the polls, the more down-ballot Republicans and Trump-skeptical operatives will speak out against him, furthering anti-Trump narratives.

Last but by no means least, while “losing candidate complains about media coverage” is the ultimate dog-bites-man story, Trump has managed to add an edge of real threat and menace to his approach.

Throughout the campaign, Trump has indicated that as president, one of his top priorities will be to make it easier to stifle media criticism of himself:

His recent anti-media tirades have, again, featured the suggestion that he’s not just complaining but would genuinely like to subject the press to an unconstitutional censorship regime.

It is not "freedom of the press" when newspapers and others are allowed to say and write whatever they want even if it is completely false! — Donald J. Trump (@realDonaldTrump) August 14, 2016

The goal of complaining about media bias is, normally, to make journalists second-guess themselves and start bending over backward to be more fair in the future. Trump’s habit of portraying himself as genuinely hostile to the principles of American press freedom tend to accomplish the opposite, emboldening skeptical reporters to see negative coverage as a patriotic duty.

Trump’s only hope for turning the ship around is to do exactly what he’s been refusing to do the entire campaign — pivot, and start running a lower-key, more disciplined, less egomaniacal campaign that’s less about his grudges and attention-seeking behavior and more about focus-grouped slams on Clinton. The hundreds of Republican Party elected officials around the country who have their fates partially yoked to his have been urging such a move for months, and it’s always possible in theory that it would happen.

But Trump has been playing the attention-seeking game for decades now, and so far his response to its inefficacy in a general election has been more thrashing. Counting on the leopard to change his spots would be a serious mistake.