Using analytical calculations and numerical simulations, it is shown that a meridional component of magnetic-flux transport will offset the shearing effect of differential rotation and give rise to rigidly rotating patterns of large-scale magnetic field. The nonaxisymmetric field attains a striped polarity pattern which rotates rigidly like a barber pole while its individual small-scale flux elements rotate at the differential rate of the latitudes they are crossing. On the sun, the meridional transport is provided by supergranular diffusion possibly assisted by a small poleward flow. New sources of flux retard this process and exclude the rigid rotation from the sunspot belts until well into the declining phase of the sunspot cycle. This mechanism accounts for a number of heretofore unexplained phenomena including the tendency for coronal holes to rotate rigidly during the declining phase of the sunspot cycle.