How to get class from widget area
Sidebars are stored in a global variable named $wp_registered_sidebars. if ( ! function_exists( ‘before_sidebar’ ) ) { function before_sidebar( $columns=”five” ) { global $wp_registered_sidebars; $class_name = $wp_registered_sidebars[$columns][‘class’]; // Apply the markup echo “<div id=’sidebar’ class=”$class_name” role=”complementary”>\n”; } } I assumed that $columns contains the sidebar ID. The value passed into before_sidebar() is the name value … Read more