In all cases where an officer in the discharge of the officer’s duty is required to post an advertisement or notice, the officer shall, when not otherwise provided, be allowed twenty-five cents, and the same mileage as a sheriff.