Title: Dynamic Class Sidebar
Last modified: August 22, 2016

---

# Dynamic Class Sidebar

 *  [nwp_developer](https://wordpress.org/support/users/nwp_developer/)
 * (@nwp_developer)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/dynamic-class-sidebar/)
 * I’m creating a wp_customize section to change the layout of my sidebar by changing
   the class of my sidebar in register_sidebar().
 * The variable passes correctly and will change the class. However, since register_sidebar
   runs at widgets_init I need to save the setting and refresh the theme customizer
   to see the changes.
 * How can I get the setting change to refresh and update automatically like the
   other settings?
 * I’m passing get_theme_mod(‘custom_setting’) as a class inside the ‘before_widget’
   => <div class=”get_theme_mod(‘custom_setting’)”>.

Viewing 1 replies (of 1 total)

 *  Thread Starter [nwp_developer](https://wordpress.org/support/users/nwp_developer/)
 * (@nwp_developer)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/dynamic-class-sidebar/#post-5702147)
 * On a related note how do you make $wp_customize->add_control show on refresh 
   of another control selection? I can create an if statement that tests if the 
   value is select in the top control to show the bottom control. However, it only
   updates when physically refreshing the page and not when the theme customizer
   refreshes the changes for preview.

Viewing 1 replies (of 1 total)

The topic ‘Dynamic Class Sidebar’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [nwp_developer](https://wordpress.org/support/users/nwp_developer/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/dynamic-class-sidebar/#post-5702147)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
