All ordinances passed by the legislative body requiring publication shall take effect from and after the due publication thereof, unless otherwise expressly provided. Ordinances not requiring publication shall take effect from their passage, unless otherwise expressly provided or ordinances required by state law to be effective only after having met specific requirements.