In 1850 Gardner, politically a Whig, was elected to the Boston City Council, serving until 1853.
The Know Nothing convention in October 1854 chose Gardner as its gubernatorial candidate,[REF] in part because his stand on slavery was not as radical as that of Republican candidate Henry Wilson, who was also seeking Know Nothing support.