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.