No sheriff, deputy sheriff or sheriff’s clerk, while in office, shall act as an attorney at law or solicitor in equity in his own name or in the name of any other person or be allowed to plead or practice in any of the courts in this State, nor shall any such officer hold the office of clerk of the court of common pleas and general sessions.