Ansel Elgort arriving at the 77th annual Golden Globe Awards on January 5, 2020, in Beverly Hills, California.
CNN  — 

Well played Ansel Elgort.

The 26-year-old posted a photo of himself nude in the shower on his verified Instagram account Tuesday, but he did it for a good cause.

The “Fault in Our Stars” actor wrote “OnlyFans LINK IN BIO” in the photos caption.

That link took followers to a GoFundMe page for fellow actor Jeffrey Wright’s Brooklyn For Life! fundraiser which is seeking to feed those on the frontlines of the fight against Covid-19.

“Our goal is to fund each Brooklyn for Life! restaurant, enabling them to provide - at no cost to the recipients - at least 75-100 meals per day for delivery to the Brooklyn frontlines of this pandemic,” a statement reads on the GoFund me page.

Elgort later posted a video on Instagram stories, noting that donations were increasing.

“I don’t know how much of this is from the post but it seems a lot of people have been giving in the last few hours,” he said. “Thanks a lot, looks like it was worth it.”

Instagram was making him take the photo down because of the nudity, he explained, and said he was considering reposting an edited, less risque version.

“Sorry if I offended anybody but we did a good thing,” the actor said. “And my dad took the picture by the way. He was mad, he said that I needed to give him credit.”

As of Wednesday the fund had raised more than $211,000.