Can we add more than one control under a setting in WP theme customizer?

I would say no, because a setting needs a unique ID, if you have two controls with the same ID, they will set the same name attribute to two different inputs in the controls and conflict so only one value will be saved.

Actually do not see much point in having them separated at all, you can’t really use one without the other in any meaningful way I can see, but maybe there is a use case for keeping them separate.

Instead if you wanted more control over a single setting you would need to create a custom control class with multiple UI inputs and javascript in it to help calculate a single setting value. But be sure to only use the setting name attribute on the actual element where the final value will be. Otherwise, better to just create another setting with it’s own control.

Leave a Comment