Bill Wackermann, the magazine publisher once known as an all-around troubleshooter, was given the ax from his job at Condé Nast Traveler on Friday, the company announced.

While getting laid off never comes at a good time, Wackermann’s heave-ho came at probably the worst time — in the middle of a morale-building Caribbean cruise with his national sales staff, sources told The Post.

Wackermann was forced to leave the group mid-cruise and fly home to get the bad news, sources said.

Prior to serving as publisher of CNT, he had been publications director of Glamour and held earlier publisher stints at Bon Appétit, Brides, Details and W during a 14-year career at the company.

Brendan Monaghan was named the new publisher and chief revenue officer of CNT, effective Dec. 7. He was raided from the New York Times, where he was a senior vice president of advertising and the publisher of T: The New York Times Style Magazine.

Only this past Wednesday, everything was looking good for Wackermann.

The high-flying publisher, who was also the magazine’s chief revenue officer, was quoted in a Nov. 18 FashionWeekDaily.com story discussing his success in the digital space and how he was going to take his staff on a cruise to celebrate a good year.

“We had an incredible year in 2015, and we realized that 85 percent of our staff had never been on [a cruise], even though it’s one of our largest travel ad categories,” Wackermann told the site. “So we made a decision to take our team on a Royal Caribbean cruise. We’re cruising out of Florida for the next three days — it’s our national sales meeting. It’s amazing. It’s been a long day — our meetings started at 7:30 this morning — and we go and go until 8 tonight. We’re doing workout sessions, digital training — everything’s about building for 2016.”

On Instagram from Montego Bay, Jamaica, Wackermann posted a photo of himself and more than 30 staffers, stating, “love this crew” #team #success@cntraveler.

Most of the staffers only officially found out about Wackermann’s dismissal via a Friday morning email from incoming CEO Bob Sauerberg, one insider said.

Although Sauerberg doesn’t officially take the CEO reins from Chuck Townsend until Jan. 1, he has been calling the shots in the executive suite since September, when his promotion was announced.

The drive at Condé Nast, like at other publishers, is to generate more revenue from digital. The Condé Nast Entertainment Group, for example, has recently gotten involved with video offerings and YouTube shows.

At Condé Nast, there has also been an equal amount of cost-cutting.

In the past week, Sauerberg has shut down Details, axed the publisher of Teen Vogue and Self and cut about seven editorial staffers from GQ.

Wackermann, who has been at Condé Nast since 2001, wrote the 2012 book, “Flip the Script: How to Turn the Tables and Win in Business and Life.”