All ordinances passed by the legislative body requiring publication take effect from and after the due publication thereof, unless otherwise expressly provided. Ordinances not requiring publication take effect from their passage, unless otherwise expressly provided.