Former President Donald J. Trump and his wife, Melania, quietly received coronavirus vaccinations in January before leaving the White House, an adviser said on Monday.The news came a day after Mr. Trump appeared at the CPAC political conference in Orlando, Fla., where for the first time he encouraged people to go get vaccinated.“Everyone should go get your shot,” Mr. Trump said during the speech. When The Times asked an adviser to the former president whether he had received his, the answer was that he had, in private, a month earlier.The secret approach by Mr. Trump came as a number of his supporters have expressed resistance to the vaccine, and as other officials have tried setting an example by getting the shot in public.President Biden, Vice President Kamala Harris and former Vice President Mike Pence received vaccine shots in front of television cameras.Mr. Trump’s concern about the vaccine has generally been about whether he is getting credit for its development while he was president. He never publicly encouraged people to take it while he was in office; the first vaccines were approved shortly after Election Day.The adviser did not say whether Mr. Trump received both his first and second shots of the vaccine in January, or if the second one was at another time.Mr. and Mrs. Trump were both infected with the coronavirus in the fall, and the former president was hospitalized with a severe case.