When President Trump holds official taxpayer-funded events outside Washington, his audiences are treated to campaign-style speeches and rock music playlists drawn from his political rallies. His appearances at the White House, most recently a rambling Rose Garden news conference, are increasingly devoid of policy and filled with attacks on the “radical left” and the presumptive Democratic presidential nominee, former Vice President Joseph R. Biden Jr.

And on Tuesday, Mr. Trump’s eldest daughter and senior adviser, Ivanka Trump, a White House employee, posted a photograph online celebrating Goya Foods, whose chief executive had recently praised her father, in what government ethics experts called a clear violation of federal law. The president followed up on Wednesday with his own photograph, featuring the company’s products arrayed on the Resolute Desk in the Oval Office.

Mr. Trump and his advisers have long tested — and often crossed — the boundaries between the official and the political. The Office of Special Counsel, an independent government watchdog agency, has found 13 Trump officials in violation of the Hatch Act, the 1939 law limiting the political activities of government employees, according to Citizens for Responsibility and Ethics in Washington, or CREW. Staff members with the watchdog group said they could recall only two such instances under President Barack Obama.