Jeremiah 20:2
Then Pashur smote Jeremiah the prophet, and put him in the stocks that were in the high gate of Benjamin, which was by the house of the LORD. Then Pashur smote Jeremiah the prophet, and put him in the stocks that were in the high gate of Benjamin, which was by the house of the LORD.
Pashur, who acted against Jeremiah, was a priest and chief governor in the house of the Lord. He struck Jeremiah himself and then put him in the stocks at the high gate of Benjamin beside the temple. That placing made Jeremiah a public spectacle. He did this because Jeremiah continued to deliver the Lord's warnings about Jerusalem and its people.
The book of Jeremiah is not arranged chronologically, and the chapter itself helps indicate when its events occurred. This nonchronological ordering does not change Jeremiah's teaching.